Questions tagged [openxml]

Questions regarding reading and writing of Microsoft Office Open XML files either through direct manipulation of the XML files contained in a zip package or through the Microsoft Office Open XML SDK.

Office Open XML File Formats Official Standard

http://www.ecma-international.org/publications/standards/Ecma-376.htm

Microsoft Office Open XML SDK 2.0

http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en

3743 questions
19
votes
3 answers

Creating custom column widths in OpenXML (excel)

I am new to OpenXML (v. 2.5), and I can create rows and cells, but I need to be able to set the column width and I can not do that correctly for some reason. Without this code: Columns cols = new Columns(); Column c1 = new…
Reid
  • 4,376
  • 11
  • 43
  • 75
19
votes
1 answer

Cannot insert the OpenXmlElement "newChild" because it is part of a tree

The Title states the error I am getting. I'm trying to hide all the text in a word doc using OpenXml. Currently when I try and append the Paragraph properties I receive the above error. I can't find much about this error online. Code that returns…
user1704863
  • 394
  • 1
  • 6
  • 19
18
votes
1 answer

What is the difference between CellValues.InlineString and CellValues.String in OpenXML?

I am trying to write some code to generate an Excel spreadsheet and I am not sure what the difference between CellValues.InlineString and CellValues.String to insert text on the cells. Shall I use this: private void UpdateCellTextValue(Cell…
mhttk
  • 1,688
  • 1
  • 16
  • 29
18
votes
4 answers

OpenXml Excel: throw error in any word after mail address

I read Excel files using OpenXml. all work fine but if the spreadsheet contains one cell that has an address mail and after it a space and another word, such as: abc@abc.com abc It throws an exception immediately at the opening of the spreadsheet:…
dovid
  • 6,354
  • 3
  • 33
  • 73
18
votes
6 answers

Matching Excel's floating point in Java

I have an .xlsx spreadsheet with a single number in the top-left cell of sheet 1. The Excel UI displays: -130.98999999999 This is visible in the formula bar, i.e. not affected by the number of decimal places the containing cell is set to show. It's…
David North
  • 1,247
  • 1
  • 14
  • 32
18
votes
2 answers

Using OpenXmlReader

I hate to resort to StackOverflow for something so (seemingly) basic, but I've been fighting with Microsoft for the last few hours and seem to be hitting a dead end. I am trying to read (large) Excel 2007+ spreadsheets, and Google has kindly…
Argent
  • 795
  • 2
  • 7
  • 25
17
votes
4 answers

How to generate Table Of Contents using OpenXML SDK 2.0?

Using the SDK I'm building Word documents that contain reports. These documents need to have TOC. Does anybody have a complete solution that I can follow in order to understand how to do this? (I've read everything on http://openxmldeveloper.org/)
Yeseanul
  • 2,787
  • 4
  • 21
  • 25
17
votes
3 answers

Formula to convert .NET pixels to Excel width in OpenXML format

I have spent many hours trying to determine a formula to convert .NET pixels to an Excel column width using the OpenXML format. I am using EPPlus to generate xmls documents. I'm trying to determine the width for a column that is to be Auto-sized. I…
Jeff Stock
  • 3,796
  • 12
  • 46
  • 61
17
votes
4 answers

How to retrieve Tab names from excel sheet using OpenXML

I have a spreadsheet document that has 182 columns in it. I need to place the spreadsheet data into a data table, tab by tab, but i need to find out as I'm adding data from each tab, what is the tab name, and add the tab name to a column in the data…
Kwalke001
  • 173
  • 1
  • 2
  • 7
17
votes
2 answers

Generate a Word document (docx) using data from an XML file / Convert XML to a Word document based on a template

I have an XML file with the data that I need to be populated on a Word document. I need to find a way, to define a template which can be used as a base line to populate data from an XML file and create an output document. I believe there are two…
slayernoah
  • 4,382
  • 11
  • 42
  • 73
17
votes
5 answers

Beginner sample codes for the Open XML SDK?

I recently started working on the Open XML SDK 2.0. I would like to know if there is any better documentation (instead of open xml sdk2.0 itself) or any other resource to learn working with the Open XML SDK?
stazera
  • 293
  • 1
  • 3
  • 9
17
votes
4 answers

How to replace content in template docx document and Open XML SDK 2.0 (Aug 09)?

I have a "template" docx document which contains the desired layout, and wish to insert content using C#, but I cannot find a way to uniquely address specific sections of the document, such as paragraphs or tables. What is the best way to uniquely…
Matthew Sharpe
  • 3,667
  • 2
  • 25
  • 24
16
votes
2 answers

How to get cell value with applied formatting (formatted cell value) with OpenXML SDK

I've been googling and searching on the site for the answer, but I couldn't find a solution - everywhere people mostly discuss how to add new number format to the document and apply it. What I need is to get the cell value as a string with applied…
El G
  • 163
  • 1
  • 1
  • 6
16
votes
1 answer

Adding autofilter and sorting causes Excel to crash

I'm developing an application where you can export some data to an Excel file using OpenXML. Everything is working fine except with the autofilter. The idea is to add an autofilter to the main body of the data so that the user automatically has…
Matt Burland
  • 44,552
  • 18
  • 99
  • 171
16
votes
2 answers

ClosedXML - Creating multiple pivot tables

I am trying to export some data to an excel sheet S1 whose data would be shown as Pivoted views in the next two sheets S2 and S3. I am able to create a single pivot and it works perfect. But when I create two pivots, the consequent Excel file…
Nikhil Girraj
  • 1,135
  • 1
  • 15
  • 33