Custom File Uploading to Disks

  • Last update:January 13, 2022
  • I. Overview

    1. Version 

    Report Server Version
    10.0


    2. Application scenarios

    After scheduled tasks are complete, you may need to export a file to a customized location instead of the default location. In this case, you can use custom attachments to change the location of the file to be exported.


    3. Functions overview

    In the File Processing step of a scheduled scheduling task, select Custom attachment processing. You can modify the location for exporting files by using custom class files.

    II. Example

    Export Excel and PDF files, and save the generated files in the specified path. In this example, the path is in the test folder on drive C.

    1. Writing class files

    1) Define an OutputExcel class file to implement OutputActionHandler<OutputClass> Interface, the specific code is as follows:

    https://code.fanruan.com/demo/example/src/release/10.0/src/main/java/com/fr/output/OutputExcel.java

    2) Compile the class file and place the generated OutputExcel. class file in the %FineReport_home%FineReport_home%\webapps\webroot\WEB-INF\classes\com\fr\output

    Note: The location of the class file only needs to correspond to the location of the "package" in the class file.


    2. Scheduled task

    1) Adding a task

    For details about how to add a task, see Task Schedule Setting.

    2) The task name is Customize_uploading_files_to_disks.

    The default user group is Platform user Anna, and click OK. As shown below:

    1.png

    3) Scheduling objects

    Click next, select the template GettingStartedEN.cpt, the file name is called test, and check excel03, excel07, word, PDF on the right side of the attachment file. As shown below:

    Note: This method does not support the check box in Dispatcher Result In addition to the general results, members of the default user group will receive individual results

    2.png

    4) Scheduling period

    Click Next and do nothing. As shown below:

    3.png

    5) File processing

    Click Next, check Custom Attachment Processing, select the OutputExcel. Class file in Section II.1. of this article, and click Save. As shown below:

    4.png

    3. Effect viewing

    Export files in different formats can be viewed under the Test folder in disk C, as shown in the following figure:

    5.png


    Attachment List


    Theme: Decision-making Platform
    • 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