2

I am just trying to export datatable as excel using open xml. Referred the below approach,

Export DataTable to Excel with Open Xml SDK in c#

But I couldn't specify the encoding format of the excel created. I want to save or create the excecl with UTF-Encoding-8 format.

Can some one help on how could the formatting specificed using Open XML

1 Answer 1

2

To save an Excel file with UTF-Encoding-8 Format you need to specify the encoding format under Tools -> Web Options -> Encoding while saving the excel file.

With OpenXML you need to create a new WebPublishing and add it to Workbook.

WebPublishing webPublishing1 = new WebPublishing(){ AllowPng = true, TargetScreenSize = TargetScreenSizeValues.Sz1024x768, CodePage = (UInt32Value)65001U };
workbook1.Append(webPublishing1);
//Where workbook1 is WorkbookPart.Workbook
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.