Jump to content
  • Spotfire® 7.12 - APIs for exporting and rendering visualizations


    This article covers Spotfire® 7.12 - APIs for exporting and rendering visualizations

     

    Introduction

    TIBCO Spotfire® 7.12 has new capabilites for exporting to PDF. A new concept of Prepared Reports provides much more powerful and flexible options to create customized reports compared to what was possible with the previous UI and API. With the support of a preview the user can more easily add custom layout for headers and footers and advanced settings such as repeating pages and visualizations per filter or bookmark. These prepared reports are saved in the analysis file and can easily be exported from the export menu, from a dedicated control in the text area, with a Automation Services task or with the new Report.Export API. Read more about the new export capabilities in What's New in TIBCO Spotfire®.

    In addition, TIBCO Spotfire® 7.12 has new and improved APIs for rendering pages and visualizations.

    This page summarizes the new and obsoleted APIs.

    Export to PDF with the Spotfire .Net API

    Spotfire 7.12 supports exporting a prepared PDF report with the Spotfire .Net API, which makes it possible to include exporting of PDF reports in custom workflows with C# extensions or IronPython scripts.

    Prepared reports are created from the Export to PDF dialog:

    preparereport.png.95709df018cc0057946da77bcd8fdb1b.png

    New APIs

    Report

    The Report class represents a prepared report used for exporting the analysis to PDF.

    Document.GetReports

    The Document.GetReports method returns the prepared reports saved in the document.

    Document.TryGetReport

    The Document.TryGetReport method returns the report specified by name.

    Deprecated APIs

    Document.Export

    The Document.Export method has been marked as obsolete (compiler warnings) and will be removed in a future release. Use Report.ExportToPdf() to export a PDF from the analysis. Enumerate reports using the Document.GetReports() method.

    Example

    The file, ExportToPDF_IronPython_example.zip (attached with this article), contains a DXP file with an IronPython script that shows how to use the API. The sample file also shows how to use the "Export Report" action control to avhieve the same result.

    Export to PDF with the Spotfire JavaScript API

    Spotfire 7.12 supports exporting a prepared PDF report with the Spotfire JavaScript API, so that you can take advantage of the PDF reporting capabilities of Spotfire in a web mashup environment.

    In addition, there is an option in the JavaScript API to launch a dialog for exporting to PDF without having a prepared report. This dialog now has the same capabilities as when using the Spotfire clients:

    • The dialog provides a preview.
    • The exported visualizations use the visual theme in the analysis.
    • The exported PDF is of a higher graphical quality.

    New APIs

    Document.getReports

    The Document.getReports method returns the names of the reports saved in the analysis.

    Document.exportReport

    The Document.exportReport method exports the report, specified by name, as PDF.

    API to render pages and visualizations to PNG images

    The Spotfire .Net API has new capabilities when rendering pages and visualizations. The resulting PNG images use the visual theme, and the API includes settings to adjust the resolution as well as the visibility of visual attributes such as annotations, axis labels, legend and title. This API is useful when creating export tools to support customized layouts or output formats.

    New APIs

    Visual.RenderAsync

    The RenderAsync method in the Visual class renders the visual asynchronously to a PNG image with the specified settings.

    Page.RenderAsync

    The RenderAsync method in the Page class enders the page asynchronously to a PNG image with the specified settings.

    RenderResult

    The RenderResult class represents the result of a rendering operation.

    RenderResultSettings

    The RenderResultSettings class represents settings concerning the resulting image used when rendering a visual or page to an image.

    VisualRenderSettings

    The VisualRenderSettings class represents the settings used when rendering a visual to an image.

    PageRenderSettings

    The PageRenderSettings class represents the settings used when rendering a page to an image.

    Deprecated APIs

    Visual.Render

    This Visual.Render() method has been marked as obsolete (compiler warning) and will be removed in a future release. Use Visual.RenderAsync(RenderResultSettings, VisualRenderSettings, CancellationToken) instead.

    VisualContent.Render

    This VisualContent.Render() method has been marked as obsolete (compiler warning) and will be removed in a future release. Use Visual.RenderAsync(RenderResultSettings, VisualRenderSettings, CancellationToken) instead.

    Attachments

    Download Attachment from Resources.

    exporttopdf_ironpython_example.zip


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...