Customize Export File Name

  • Last update:  2021-12-10
  • I. Overview

    1. Version description

    Report server version
    Function changes
    10.0.19There is an additional event type "Export Event" in the general report. Users can export the template to a file through this event and support customize export file name.


    2. Application scenarios

    When the template is exported as a file, the file name defaults to the name of the template. If users want to customize the export file name, they usually need to use JavaScript code.

    But on the one hand JavaScript has a certain threshold, on the other hand it is more complicated to maintain.

    In response to the above problems, the 10.0.19 version adds an export event. You can customize the file name while selecting the export file type without using JavaScript code.

    1.gif


    3. Function entrance

    Currently, only .cpt reports are supported. A new type of widget event is added to the .cpt reports: "Export Event", as shown in the following figure:

    This event can be realized at the same time: file export + customize file name.

    2.png

    II. Function introduction

    1. Export settings

    • Export template: The default is to export the current template, or you can choose to export other templates. When you select other templates, you need to select them in the report project directory, and you can only select ordinary reports.

    • Export method: You can choose PDF export, Excel export, Word export, and picture export.

    • Export file name: If you select default, the file name is the template name.If you select custom,  the use of formulas and strings are supported to define the file name, and the formula is the equal sign in front of the edit box, and the string just remove the equal sign in front of it.

    Note: When customizing the export file name, some special symbols, cells, and hierarchical coordinate functions are not supported. For details, please refer to the red prompt text in the interface below.

    3.png


    2. Parameters

    By default, Inherit Report Parameters is checked. At this time, it will be exported according to the current session parameters, that is, if the query is not clicked, the parameters selected in the current parameter pane will be used for export.

    4.png

    Uncheck Inherit Report Parameters, the user can customize the parameters.

    5.png

    III. Examples

    1. Design template

    Open the designer's built-in template: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\GettingStarted.cpt


    2. Add event

    Drag a button widget in the parameter pane, rename it to Export Template, add a click event to the button, and select Export Event as the type.

    Select Export Excel (export as is) as the export method, and the export file is customized with a formula: =$region + "area sales overview", as shown in the figure below:

    6.png


    3. Effect preview

    After saving the report and click PC Preview, the effect of the exported file is shown in I.2. Application Scenarios.

    App and HTML5 previews are not supported.

    IV. Template download

    For the completed template, see: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-en\SpecialSubject\Customize _Export_File_Name.cpt

    Click to download the template:

    Customize_Export_File_Name.cpt


    Attachment List


    Theme: Report Application
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy