Skip to main content

Can't export IncludeHtml to NativeExcel, wraps HTML in SPAN tag


1 comment

  • Johnny Stevens

    After reviewing with Logi Engineering, we found that Logi's NativeExcel exporter/renderer doesn't accept SVG code. I solved this requirement by using the following process:

    1. Generate the Chart in Info
    2. Use HighCharts' getSVG API to get the SVG for the chart
    3. --stop here and pass the SVG as Hidden Input if you want PDF export--
    4. Write the SVG to a hidden (in CSS) IMG element
    5. When the img loads, copy its contents to an HTML CANVAS element
    6. Use the Canvas element's toDataURL API
    7. Store the resulting DataURL (minus the prefix) in a Hidden Input
    8. Pass that Hidden Input as a Request Token (POST) to a new report definition
    9. In the new definition, use a DataLayer.Static to grab the Token value
    10. Add a FileColumn element to write the Token to the file server as a PNG
    11. Present the PNG on the page as the Caption in an Image Element
    12. Export this page/report to Excel

    This feels convoluted but it works, and it is typically much faster than using the Action.NativeExcel which re-runs the entire report to generate the Excel. I'll create a separate forum post with a full reproducer so the option isn't hidden under this specific topic.


Please sign in to leave a comment.