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
8
votes
1 answer

What's the difference between and in Office Open XML?

What's the difference between these two Office Open XML fragments? btyler and btyler note: The second sample I created manually based on the spec, the first is from an actual…
Samuel Neff
  • 73,278
  • 17
  • 138
  • 182
8
votes
1 answer

How serve a downloadable excel file created with OpenXml, in .NET Core

I generated an excel file with OpenXml 2.7.2 in .NETCoreApp 1.1 and saved it into a project folder. Then in my function I read the bytes and try to return it as a File. I don't get an error, but in the response I just get back the binary. So it…
jonv562
  • 293
  • 1
  • 4
  • 23
8
votes
1 answer

C# OpenXML: Number Format is not applied

I'm trying to format decimal and integer numbers like "1,000.00" in my .xlsx file. The code for generating stylesheet: private Stylesheet GenerateStylesheet() { //styling and formatting var cellFormats = new CellFormats(); uint…
user1016945
  • 877
  • 3
  • 22
  • 38
8
votes
1 answer

OpenXML having trouble coloring cells

I am attempting to style cells and I cant get the colors to work correctly, I am using the following Fill: // Fill fill0 = new Fill(); // Default fill Fill fill1 = new Fill( new PatternFill( new ForegroundColor() { Rgb =…
naspinski
  • 34,020
  • 36
  • 111
  • 167
8
votes
2 answers

The specified package is invalid. The main part is missing

Below given is a merge function which is intended to merge all docx files in a folder and produce the merged file. public void Merge() { try { string sid = Request.QueryString["studid"]; string stud = sid.ToString(); …
Binto
  • 99
  • 1
  • 1
  • 11
8
votes
3 answers

Link to Microsoft Open XML SDK tutorials

Anyone know any link to a good Microsoft Open XML tutorials?
Waliaula Makokha
  • 815
  • 1
  • 11
  • 21
8
votes
2 answers

OpenXml create word document and download

I'm just starting to explore OpenXml and I'm trying to create a new simple word document and then download the file Here's my code [HttpPost] public ActionResult WordExport() { var stream = new MemoryStream(); …
DJPB
  • 5,429
  • 8
  • 30
  • 44
8
votes
5 answers

How can I embed any file type into Microsoft Word using OpenXml 2.0

I spent a lot of time trying to figure out a good way to embed any file into Microsoft Word using OpenXml 2.0; Office documents are fairly easy but what about other file types such as PDF, TXT, GIF, JPG, HTML, etc.... What is a good way to get this…
D Lyonnais
  • 323
  • 1
  • 3
  • 9
8
votes
3 answers

Export big amount of data from XLSX - OutOfMemoryException

I am approaching to export a big amount of data (115.000 rows x 30 columnd) in Excel OpenXML Format (xlsx). I am using some libraries like DocumentFormat.OpenXML, ClosedXML, NPOI. With each of this, OutOfMemoryException is thrown because the…
Gianluigi Liguori
  • 351
  • 1
  • 5
  • 13
8
votes
1 answer

How to AutoFit excel column using OpenXML Package

This code to generate Excel spreadsheet Using openxml package. Please anyone tell how to auto fit its column width. OpenXmlPackage.SpreadsheetDocument spreadsheetDocument = OpenXmlPackage.SpreadsheetDocument.Create(downloadFilePath,…
Prakash Gupta
  • 203
  • 1
  • 4
  • 13
8
votes
1 answer

How to make excel work sheet header row bold using OpenXML

I am using openXML, Asp.net and c# to create an Excel workbook, I have a requirement that to make Header row of all sheets should be bold. WorkbookStylesPart stylesPart = workbookpart.AddNewPart(); stylesPart.Stylesheet =…
Aruns
  • 157
  • 1
  • 1
  • 9
8
votes
2 answers

Theme confusion in SpreadsheetML

I've been fighting this all day. Inside my styles.xml file I have color information given like so: ECMA 376 defines a theme color reference as: Index into the collection, referencing…
dmaruca
  • 485
  • 2
  • 5
  • 16
8
votes
2 answers

Why appending AutoFilter corrupts my excel file in this example?

Hi I use the below method to apply an AutoFilter : public static void ApplyAutofilter(string fileName, string sheetName, string reference) { using (SpreadsheetDocument document = SpreadsheetDocument.Open(fileName, true)) …
pencilCake
  • 51,323
  • 85
  • 226
  • 363
8
votes
4 answers

Open XML SDK to edit Active document

Is it possible to use the Open XML sdk to manipulate parts of document which is currently open in the Office app (word/ppt). I know the easiest thing is to use VSTO, but its slow and would involve clipboard use to insert elements, the OXML sdk is…
user240282
  • 127
  • 1
  • 6
8
votes
3 answers

How can I embed some VBA code into a spreadsheet created using ClosedXML?

I am using ClosedXML to generate spreadsheets from C# (asp.net-mvc) and it works great. I have one additional requirement so I wanted to get some feedback on how I could achieve this. I want to save as a macro enabled workbook and when I just give…
leora
  • 188,729
  • 360
  • 878
  • 1,366