This is a migrated thread and some comments may be shown as answers.

Removing BOM from exported XLSX embedded XML files

3 Answers 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Severin
Top achievements
Rank 1
Severin asked on 04 Apr 2016, 08:09 PM

I am using the report processor in Telerik Reporting Q1 2016 to render a report directly to a XLSX, e.g.:

   var deviceInfo = new System.Collections.Hashtable();

   var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();

  var result = reportProcessor.RenderReport("XLSX", instanceReportSource, deviceInfo);

 

The problem is that the XML files inside the XLSX file container all begin with a Byte Order Mark (EF BB BF). This is causing one of my customer's open source libraries to fail on reading the XLSX file.

 

If I open the exported file in Excel and then save it again, the BOM are removed.

 

So, is there a way to prevent the generation of the BOM in the first place?

3 Answers, 1 is accepted

Sort by
0
Severin
Top achievements
Rank 1
answered on 04 Apr 2016, 08:32 PM

Further to the above, a little bit of research suggests that the BOM is optional (and undesirable for compatibility) for UTF-8 encoded files.

Comments?

0
Stef
Telerik team
answered on 07 Apr 2016, 12:55 PM
Hi Severin,

The CSV rendering provides a setting allowing you to skip the BOM - CSV Device Information Settings.
For XLSX format, there is no such setting, and the approach I can suggest you is to post-process the XLSX file by extracting its content and modifying it to cover the requirements of the used third-party Excel viewer.


Also feel free to log a feature request elaborating on the case and the need to skip the BOM.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Accepted
Severin
Top achievements
Rank 1
answered on 07 Apr 2016, 05:51 PM
http://feedback.telerik.com/Project/162/Feedback/Details/188622-rendering-to-xlsx-should-not-add-bom-to-xml-files
Tags
General Discussions
Asked by
Severin
Top achievements
Rank 1
Answers by
Severin
Top achievements
Rank 1
Stef
Telerik team
Share this question
or