openxml-sdk

Open XML: Word - Getting all Paragraphs marked as “Heading1” style

夙愿已清 提交于 2020-08-21 05:36:46
问题 Using Word I have created a Docx with the standard normal.dot as a test. Hello-world level complexity. I wish to get all the paragraphs which are styled with the " Heading1 " style in Word. I can get all the paragraphs, but don't know how to filter down to Heading1. using (var doc = WordprocessingDocument.Open(documentFileName, false)) { paragraphs = doc.MainDocumentPart.Document.Body .OfType<Paragraph>().ToList(); } 回答1: [Test] public void FindHeadingParagraphs() { var paragraphs = new List

Retrieve cell value issue with open xml sdk

故事扮演 提交于 2020-06-18 16:56:40
问题 Im having the following issue related with an excel 2007 file called "Libro1.xlsx". On this file i already set to "hello world" the cell A1 in the first sheet with id "rId1" and cell A2 to "500". In the following code you'll see that im accesing every row and cell of this sheet. Im getting as output the content of the cell A2 = 500 but not the content of the A1 cell (im getting "0" as value). Here the code that im using: ' Open the document for editing. Dim ficheroexcel As SpreadsheetDocument

Retrieve cell value issue with open xml sdk

≯℡__Kan透↙ 提交于 2020-06-18 16:53:45
问题 Im having the following issue related with an excel 2007 file called "Libro1.xlsx". On this file i already set to "hello world" the cell A1 in the first sheet with id "rId1" and cell A2 to "500". In the following code you'll see that im accesing every row and cell of this sheet. Im getting as output the content of the cell A2 = 500 but not the content of the A1 cell (im getting "0" as value). Here the code that im using: ' Open the document for editing. Dim ficheroexcel As SpreadsheetDocument

OpenXML 2.0 Gets wrong cell value

社会主义新天地 提交于 2020-02-22 07:32:46
问题 I'm having a bit of a problem reading a value from an Excel 2010 worksheet. On a standard Excel 2010 worksheet I have a cell with the currency format with two decimal places and the value 1270,14 € . When I read this value on OpenXML 2.0 (C# code) I get 1270.1400000000001 instead of the original 1270.14 . The same happens with other values on any cell with the same formating. Get value from cell OpenXML code: private string GetCellValue(string column, int row) { column = column.ToUpper(); var

OpenXML 2.0 Gets wrong cell value

佐手、 提交于 2020-02-22 07:30:12
问题 I'm having a bit of a problem reading a value from an Excel 2010 worksheet. On a standard Excel 2010 worksheet I have a cell with the currency format with two decimal places and the value 1270,14 € . When I read this value on OpenXML 2.0 (C# code) I get 1270.1400000000001 instead of the original 1270.14 . The same happens with other values on any cell with the same formating. Get value from cell OpenXML code: private string GetCellValue(string column, int row) { column = column.ToUpper(); var

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

.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