tagged [openxml]

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

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...

3 May at 16:31

C# EPPlus OpenXML count rows

C# EPPlus OpenXML count rows With EPPlus and OpenXML does anyone know the syntax on how to count the rows? Say my worksheet is called "worksheet" `int numberRows = worksheet.rows.count()`? or `workshe...

23 Mar at 10:9

create word document with Open XML

create word document with Open XML I am creating a sample handler to generate simple Word document. This document will contains the text This is the code I use (C# .NET 3.5), I got the Word document ...

23 Mar at 04:56

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

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 f...

1 Sep at 09:56

OpenXml Cannot open package because FileMode or FileAccess value is not valid for the stream

OpenXml Cannot open package because FileMode or FileAccess value is not valid for the stream The stream comes from an html form via ajax `var jqXHR = data.submit();` ``` public static GetWordPlainText...

7 May at 05:42

Add HTML String to OpenXML (*.docx) Document

Add HTML String to OpenXML (*.docx) Document I am trying to use Microsoft's OpenXML 2.5 library to create a OpenXML document. Everything works great, until I try to insert an HTML string into my docum...

23 May at 12:16

how can I change the font open xml

how can I change the font open xml How can I change the font family of the document via OpenXml ? I tried some ways but, when I open the document, it's always in Calibri Follow my code, and what I tri...

1 May at 11:3

How to insert line break within OPENXML spreadsheet cell?

How to insert line break within OPENXML spreadsheet cell? I'm currently using something like this to insert inline string in a cell : But `\n` doesn't work to insert line break, how can i do this? ---

How to convert xls file to xlsx file using C#?

How to convert xls file to xlsx file using C#? I was developing an application which read data from an excel file, but when I try to open it, an exception  was thrown if the source file is saved with ...

8 Feb at 11:22

openXML spreadsheetdocument return byte array for MVC file download

openXML spreadsheetdocument return byte array for MVC file download I'm trying to return a openXML spreadsheetdocument as a byte[] which I can then use to allow my MVC to send that file to a user. her...

OpenXml Excel: throw error in any word after mail address

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 ano...

30 Apr at 14:45

Inserting newlines in Word using OpenXML

Inserting newlines in Word using OpenXML I am using openxml WordProcessingDocument to open a Word template and replace placeholder x1 with a string. This works fine unless I need the string to contain...

2 Feb at 18:44

Excel 2003 XML format - AutoFitWidth not working

Excel 2003 XML format - AutoFitWidth not working I have a program that spits out an Excel workbook in Excel 2003 XML format. It works fine with one problem, I cannot get the column widths to set autom...

13 Dec at 22:51

Set custom BackgroundColor of a Excel sheet cell using epplus c#

Set custom BackgroundColor of a Excel sheet cell using epplus c# The problem: I am using EEPlus. I am stuck at applying a hex color code, e.g. `#B7DEE8`, for a cell in my Excel sheet. I got the follow...

13 Jan at 13:15

Invalid Hyperlink: Malformed URI is embedded as a hyperlink in the document

Invalid Hyperlink: Malformed URI is embedded as a hyperlink in the document I'm using the OpenXml namespace in my application. I'm using this to read the XML within an Excel file. This works fine with...

6 Dec at 09:3

How to create *.docx files from a template in C#

How to create *.docx files from a template in C# I have a working ASP.NET MVC web application to manage projects and customers. Now I want to generate a word file for some customers. In this file shou...

17 Apr at 20:34

Creating Excel document with OpenXml sdk 2.0

Creating Excel document with OpenXml sdk 2.0 I have created an Excel document using OpenXml SDK 2.0, now I have to style It, but I can`t. I don't know how to paint the background color or change the f...

18 Mar at 08:47

How to include the reference of DocumentFormat.OpenXml.dll on Mono2.10?

How to include the reference of DocumentFormat.OpenXml.dll on Mono2.10? I am using C#.net Windows Desktop Application.I want to run these application with other platform also. So, i am using Mono 2.10...

10 Mar at 10:36

How can I create multistyled cell with EPPlus library for Excel

How can I create multistyled cell with EPPlus library for Excel I use [EPPlus](http://epplus.codeplex.com/) for Excel file generation. I mean I need to convert HTML text (bold, italic, font color, nam...

2 Nov at 08:50

OpenXML - Cell.DateType is null

OpenXML - Cell.DateType is null I can't determine when a Cell is a date. [](https://i.stack.imgur.com/dWi6P.png) I noticed the DataType is null so I can't distinguish if it's a Number of a Date. I am ...

16 Apr at 23:0

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

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 mo...

19 Jan at 18:35

Replacing Content Controls in OpenXML

Replacing Content Controls in OpenXML I need something as a placeholder. I at first looked to Content Control as a solution but I'm having some problems with it. I then looked into adding CustomXML to...

OpenXML - Writing a date into Excel spreadsheet results in unreadable content

OpenXML - Writing a date into Excel spreadsheet results in unreadable content I am using the following code to add a `DateTime` to a column in my spreadsheet: ``` var dt = DateTime.Now; r.AppendChild(...

24 Jun at 15:50

Get the Column Index of a Cell in Excel using OpenXML C#

Get the Column Index of a Cell in Excel using OpenXML C# I've been looking around for a while now and cannot seem to find out how to do this. I've got an excel sheet, which I'm reading using OpenXML. ...

5 Mar at 10:38

Using OpenXmlReader

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...

11 May at 16:50