Removing BOM from exported XLSX embedded XML files

4 posts, 1 answers
  1. Severin
    Severin avatar
    3 posts
    Member since:
    Oct 2015

    Posted 04 Apr Link to this post

    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?

  2. Severin
    Severin avatar
    3 posts
    Member since:
    Oct 2015

    Posted 04 Apr Link to this post

    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?

  3. DevCraft banner
  4. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 07 Apr Link to this post

    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
  5. Answer
    Severin
    Severin avatar
    3 posts
    Member since:
    Oct 2015

    Posted 07 Apr in reply to Stef Link to this post

    http://feedback.telerik.com/Project/162/Feedback/Details/188622-rendering-to-xlsx-should-not-add-bom-to-xml-files
Back to Top