Successfully!

Error!

Dashboard Export

  • Last update:  2024-04-22
  • Overview

    Version

    Report Server Version
    Functional Change

    11.0

    /

    11.0.1

    Added the export interface &op=export&format=xxx.

    11.0.14

    Optimized the logic for the Dashboard Export plugin taking effect. The plugin does not take effect in new dashboards. If you use the Dashboard Export Plus plugin, the export will take the plugin rules as a priority.

    11.0.17

    Allowed you to export dashboards as PDF files with the new adaptation attribute and supported the watermark function for a single template.

    11.0.22

    Allowed you to export dashboards as PDF files with the new adaptation attribute and supported the global watermark function.

    Application Scenario

    FineReport 11.0 includes two types of dashboards: dashboards and old dashboards. The main difference between them lies in the adaptation attribute.

    Besides, dashboards and old dashboards also differ in the export method. This document mainly introduces how to export dashboards with the new adaptation attribute on PC in FineReport 11.0. For the export method for old dashboards, see Dashboard Export Plugin.

    Function Description

    In FineReport 11.0.1 and 11.0

    You can export dashboards as Excel, PDF, Word, and PNG files.

    • The export interface for the general dashboard is &export_format=xxx, where xxx represents the parameter corresponding to the export format.

    • You need to add sessionID in the export suffix for dashboards with parameters to form &export_format=xxx&sessionID=***.

    • You can customize the size during export by adding the parameter &width=1920&height=1080 at the end of the suffix.

    • You can modify the file name during export by adding the parameter &__filename__=File name at the end of the suffix.

    In FineReport 11.0.22 and Later Versions

    You can export dashboards as Excel, PDF, Word, and PNG files.

    • The export interface for the general dashboard is &op=export&format=xxx or &export_format=xxx, where xxx represents the parameter corresponding to the export format.

    • You need to add the export suffix sessionID for the dashboard with parameters to form &op=export&format=xxx&sessionID=*** or &export_format=xxx&sessionID=***.

    • You can customize the size during export by adding the parameter &width=1920&height=1080 at the end of the suffix.

    • You can modify the file name during export by adding the parameter &__filename__=File name at the end of the suffix.

    Export Scenario Introduction

    The following table shows supported (represented by the checkmark) and unsupported (represented by the blank content) scenarios during export.

    Function
    Export as WordExport as ExcelExport as PDFExport as PNG

    Body background



    Dynamic background





    Color set in Body Background for chart/report blocks

    Gradient Color set in Body Background for chart/report blocks


    Image set in Body Background for chart blocks


    Image set in Body Background for report blocks



    Opacity for the component/body background




    Component overlap



    Component rounded corner



    Incomplete cell display



    Parameter panel or parameter panel widget





    Widget (with display values) in the body

    Line-type borders set in Border for a component



    Custom Image set in Border for a component





    Rich text

    Watermark




    Mobile Terminal





    Only the first tab is exported for the Tab component.

    Only the first page will be exported if multiple pages exist in a report block.

    The Tab component will always be located at the bottom layer in the exported file if components are overlapped.

    If you export dashboards as Excel files through &export_format=xxx, data from the extended part of the scrollbar can also be exported. (This scenario is only supported in dashboards with the old adaptation function.)
    If you export dashboards as Excel files through the interface &op=export&format=xxx, data from the extended part of the scrollbar cannot be exported.

    Exporting the General Dashboard

    If you want to export dashboards without parameters as Excel, PDF, Word, or PNG files, you only need to add the suffix &op=export&format=xxx at the end of the URL during the preview on PC and press the Enter key for export. xxx represents the parameter corresponding to the export format, as shown in the following table.

    Export Format
    Added Suffix

    Excel

    &op=export&format=excel

    Word

    &op=export&format=word

    PDF

    &op=export&format=pdf

    PNG

    &op=export&format=image

    iconNote:
    You can also export dashboards without parameters through the export interface &format=xxx.

    For example, export the dashboard as an Excel file, as shown in the following figure.

     1.png

    Exporting Dashboards with Parameters

    If parameters exist in a dashboard, the content of the dashboard or components in the dashboard will change with the parameters (such as parameter queries and parent-child reports). In this case, if you want to export dashboards through the URL, you need to add sessionID to export the current query results. Otherwise, the exported content will be inconsistent with the parameter query content.

    iconNote:
    When a browser requests a Web service and creates a session, the server generates a unique session identifier (namely sessionID) for each session and returns the session identifier in the form of long integer data. sessionID can be considered as the ID record of the current session.

    Adding the After Initialization Event

    In a dashboard with parameters, you need to add an After Initialization event for para on the parameter panel to return sessionID.

    Select the parameter panel, add an After Initialization event, add a parameter aaa, set Value to Formula, enter the formula sessionID, and enter the following JavaScript code, as shown in the following figure.

     2.png

    Obtaining the sessionID and Exporting the Query Result

    1. Save the report and click PC Preview. A dialog box displaying sessionID pops up. Copy the current session ID, and click OK, as shown in the following figure.

     3.png

    iconNote:
    sessionID changes every time you refresh the page.

    2. Add the suffix &op=export&format=xxx&sessionID=*** at the end of the URL. xxx represents the parameter corresponding to the format of the to-be-exported file. *** represents the currently-copied sessionID. Press the Enter key to export the current query result.

     4.png

    Template Download

     You can download the example template Exporting FRM Reports with Parameters.frm.

    Exporting Dashboards with Parameters by Clicking the Button Through JS

    You can also export dashboards with parameters by adding a Button widget on the parameter panel (or directly adding a Button widget in the body), adding the parameter aaa to obtain the current sessionID, and adding a Click event for export.

    Adding a Button Widget

    Take the above example template as an example. Add a Button widget on the parameter panel and name the button Export Excel, as shown in the following figure.

     5.png

    Adding a Click Event

    Select the button widget, add a Click event, add a parameter aaa, set Value to Formula, enter the formula sessionID, and enter the following JavaScript code, as shown in the following figure.

    var REPORT_URL ='${servletURL}?viewlet=doc/frm/Exporting FRM Reports with Parameters by Clicking the Button Through JS.frm&op=form_adaptive&op=export&format=excel&sessionID=' + aaa;
    window.location = encodeURI(REPORT_URL);

    6.png 

    Effect Display

    Save the report, click PC Preview, click Query, and click Export Excel. The following figure shows the effect.

     7.png

    Template Download

    You can download the example template Exporting FRM Reports with Parameters by Clicking the Button Through JS.frm.


    Attachment List


    Theme: Report Application
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback