Exporting an Analytic Application as a PDF

As an analytic application designer, you can allow users to export an application as a PDF file when running the application.

Context

Only visible content on your application page can be exported to the PDF file. Therefore, the following invisible elements will not be exported:

  • invisible part in scrollable charts, tables or tab strips

  • collapsed table cells

  • lazy rendered widgets

  • lazy loaded data source

  • comments on invisible data cells

Besides these invisible elements, custom widgets and web page widgets won’t be exported.

For a popup, only a popup that’s visible in an analytic application, namely a popup a user has triggered to pop up when running an application will be exported as a separate page in the PDF file.

Note
Same as that in a story, for a R visualization widget, static plots will be exported. But if the R widget is written in RHTML (iFrame) instead, it won’t be exported.

Procedure

  1. In the Scripting section of the Outline, select right next to Export to PDF to create a technical object.
  2. The side panel Export to PDF opens with a default name ExportToPDF_1 displayed. You can set the following properties according to your needs:
    • Change the default name of the technical object.

    • Select the paper size of the exported PDF as Auto, A2, A3, A4, A5, Letter or Legal.

    • Select the orientation of the exported PDF as Landscape or Portrait. The Orientation option is disabled when the paper size is set to Auto.

    • Select the location of the page number as Header, Footer or None.

    • Edit the file name, the header, the footer for the exported PDF.

    • Choose whether or not to export the appendix. The appendix will be exported as separate page.

    • Choose whether or not to export the comments. Comments of invisible widget will not be exported. The comments will be exported as separate pages.

      Note
      If you haven't enable the option Commenting in Embedded Mode via Start of the navigation pathSystem Next navigation step Administration Next navigation step System ConfigurationEnd of the navigation path, the commenting related settings and APIs won’t take effect.
  3. Click Done to finish creating the technical object.
  4. To invoke the Export to PDF function, write the script ExportToPDF_1.exportView() for the triggering event of the canvas or a widget. For example, if you want to invoke the function when clicking a button, write the script for the onClick() event of the button.
    Note
    Similar to exporting to PDF in a story, the API that triggers the export is supported only in Microsoft Edge and Google Chrome, but not in Internet Explorer.
  5. As an application designer, the properties you defined in the Export to PDF panel will be the default export settings for all users running the application. To offer end users the flexibility to customize the export settings, you can design a new settings panel or dialog by leveraging relevant APIs. For detailed information about the APIs, refer to Analytics Designer API Reference.

Results

An exported PDF is saved to your local machine, which shows exactly what appears on the application running page.