openxml

Modify excel cell

霸气de小男生 提交于 2020-02-20 08:02:28
问题 Good morning, I would like to edit some cells from already existing excell file. I tried use EPPlus and normal OpenXml classes. However I failed. In both situation program won't crash but always return old (not modified) excel. Please, what am I doing wrong? Trial 1 - EPPlus: MemoryStream memoryStream = new MemoryStream(); using (var fs = new FileStream(@"Path\Test.xlsx", FileMode.Open, FileAccess.Read)) { byte[] buffer = new byte[1024]; int bytesRead = 0; while ((bytesRead = fs.Read(buffer,

How to extract OLE file from Word(.Docx) by OpenXML through C#

ⅰ亾dé卋堺 提交于 2020-02-06 04:31:08
问题 I want to use Openxml to abstract "OLE package" from an ".docx" file. I don't know how to do it,and I didn't find any example about it in offical examples. Please help me. This is my attempt: 1.I build a Docx file by "MS office 2016" named "Test.docx", and insert an ".zip" file into "Test.docx". I open "Open XML SDK 2.5 Productivity Tool" to Watch "Test.docx", I find this(Figure 1), but I don't get any information about how to extract this zip file through the reflect code. 2.Then I try to

How to extract OLE file from Word(.Docx) by OpenXML through C#

萝らか妹 提交于 2020-02-06 04:31:06
问题 I want to use Openxml to abstract "OLE package" from an ".docx" file. I don't know how to do it,and I didn't find any example about it in offical examples. Please help me. This is my attempt: 1.I build a Docx file by "MS office 2016" named "Test.docx", and insert an ".zip" file into "Test.docx". I open "Open XML SDK 2.5 Productivity Tool" to Watch "Test.docx", I find this(Figure 1), but I don't get any information about how to extract this zip file through the reflect code. 2.Then I try to

How to read Excel XML (C#)

允我心安 提交于 2020-02-02 03:06:31
问题 I wonder if there is an easy way to read Excel 2010 XML? This XML has a different structure than I used to read. Especially ss:index attribute (ss:Index**="7") makes things a bit more complicated EDIT : To explain better: I have file with XML extension which can be easily opened in Excel I'm looking a way to read this sheet programically (eg copy to DataTable) Noticed this is not common XML I used to work XML defines fields on the begining, than use ROW, CELL and DATA tags What surprised me

.NET OpenXML performance issues

被刻印的时光 ゝ 提交于 2020-01-31 08:53:10
问题 I am attempting to write out an Excel file from an ASP.NET web server using OpenXML. I have about 2100 records and its taking around 20-30 seconds to do this. Any way I can make it faster? Retrieving the 2100 rows from the db takes a fraction of a second. Not sure why manipulating them in memory would take any longer. Note: ExcelWriter is our custom class, but all its methods are directly from code in this link, http://msdn.microsoft.com/en-us/library/cc861607.aspx public static MemoryStream

.NET OpenXML performance issues

Deadly 提交于 2020-01-31 08:52:46
问题 I am attempting to write out an Excel file from an ASP.NET web server using OpenXML. I have about 2100 records and its taking around 20-30 seconds to do this. Any way I can make it faster? Retrieving the 2100 rows from the db takes a fraction of a second. Not sure why manipulating them in memory would take any longer. Note: ExcelWriter is our custom class, but all its methods are directly from code in this link, http://msdn.microsoft.com/en-us/library/cc861607.aspx public static MemoryStream

.NET OpenXML performance issues

*爱你&永不变心* 提交于 2020-01-31 08:52:05
问题 I am attempting to write out an Excel file from an ASP.NET web server using OpenXML. I have about 2100 records and its taking around 20-30 seconds to do this. Any way I can make it faster? Retrieving the 2100 rows from the db takes a fraction of a second. Not sure why manipulating them in memory would take any longer. Note: ExcelWriter is our custom class, but all its methods are directly from code in this link, http://msdn.microsoft.com/en-us/library/cc861607.aspx public static MemoryStream

Change Page size of Wor Document using Open Xml SDK 2.0

旧城冷巷雨未停 提交于 2020-01-25 07:55:09
问题 My application needs export custom report to Word document using Open xml Sdk 2.0 My Export function works fine except I need to increase Page size for showing it properly. (else word wrap will be an issue and Report won't look nice). Can any one suggest me how can I adjust Page size according to width of my report. I also need another help in alignment in word documet. Link for post is Horizontal Text alignment in Word using OpenXml Sdk 2.0 回答1: Hmm.. at last found the answer.. I will post C

Export docx/doc First Header and Footer as docx File Using openXML

坚强是说给别人听的谎言 提交于 2020-01-24 21:27:28
问题 I want to ask how can i convert Header/Footer part of MS Word Document (doc/docx) to HTML. I'm opening the Document like: using (WordprocessingDocument wDoc = WordprocessingDocument.Open(memoryStream, true)) a.k.a OpenXML I'm converting the Document with WmlToHtmlConverter which converts the document excellent except that the headers and footers are skipt, cuz html standart doesnt support pagination. I was wondering how can i get them and extract them as html. I'm trying by getting them like

Exporting data to excel format : error when opening resulting file

心已入冬 提交于 2020-01-24 19:31:31
问题 I made a routine to export a data table to excel. However, when I open the generated file in Excel 2013, I obtain an error saying Repaired Records: "Informations of cell in part /xl/worksheets/sheet1.xml" even though, when I click OK the document opens apparently well. The data appears to be ok. The code of the controller is: public IActionResult ExportingXl() { OrdListViewModel o = HttpContext.Session.GetJson<OrdListViewModel>("MyVar"); ExportExcelModel x = new ExportExcelClass(o.oTable); //