Large Dataset Export with the New Calculation Engine Enabled

  • Last update:September 18, 2025
  • Overview

    Version

    Report Server Version 
    Functional Change
    11.0

    /

    11.0.10

    Added support for exporting CSV files with a custom encoding format via the CSV Export Encoding plugin.

    Application Scenario

    The new calculation engine helps address the issue of slow loading during template previews, but the problem of slow exporting remains. In this case, this document provides you with a solution to resolve this problem.

    iconNote:
    This document introduces how to export the data from the dataset used in the template, not the template itself.

    Implementation Method

    The slow exporting speed is primarily caused by the need to compute all templates before exporting. Therefore, as long as the new engine supports large dataset export, this issue will be resolved.

    By adding a custom button on the toolbar and defining a custom JavaScript event, you can export large datasets with the exporting speed significantly improved.

    iconNote:

    1. Both CPT and CPTX formats are supported. CPTX templates refer to reports created in the FineReport of V10.0 with the new calculation engine enabled.

    2. The exported data should not exceed 10 million rows by 20 columns, because exporting excessively large datasets may result in only part of the data being exported.

    Example One: FineReport of Versions Before 11.0.10

    Custom Button

    1. Open the template Row-based Report.cpt. New Calculation Engine is enabled in this template. For details, see Usage Instruction to the New Calculation Engine.

    2. Choose Template > Web Attribute > Pagination Preview Setting, and select Set for This Template Separately from the drop-down list of Following Settings, as shown in the following figure.

     1.png

    3. Add a custom button to the toolbar, and click the top toolbar editing button, as shown in the following figure.

     2.png

    4. Set Widget Alias of the custom button to Large Dataset Export, and click Custom Event, as shown in the following figure.

     3.png

    5. In the Set Callback Function window, enter the JavaScript code, as shown in the following figure.

     4.png

    The JavaScript code is as follows:

    // The name of the datasets to be exported: You can use encodeURIComponent to prevent Chinese characters from garbling.
        var dsName = encodeURIComponent("ds1");
        // The server address: The IP address, port number, and web application name should be adjusted according to the actual situation.
        var url = "http://localhost:8075/webroot/decision/url/report/v10/direct/export" + "?sessionID=" + Report.SessionMgr.get() + "&dsName=" + dsName;
        // The following section is for exporting the dataset as a form.
        var form = $("<form>");
        $("body").append(form);
        if (url.indexOf('?') !== -1) {
            var q = url.substr(url.indexOf('?') + 1);
            var qs = q.split('&');
            for (var i = 0; i < qs.length; i++) {
                var p = qs[i];
                var ps = p.split('=');
                if (ps.length === 2) {
                    $('<input/>').attr('name', ps[0]).val(ps[1]).appendTo(form);
                }
            }
            url = url.substring(0, url.indexOf('?'));
        } else {
            var input = $("<input>");
            form.append(input);
        }
        form.attr({"style": "display : none", "target": "", "method": "post", "action": url});
        form.submit();
        form.remove();

    Effect Display

    Save the report and click Pagination Preview. The following figure shows the preview effect.

     gif5.gif

    Template Download

    For details, you can download the template: Large Dataset Export with the New Calculation Engine Enabled.cpt

    Example Two: FineReport V11.0.20 and later versions

    Custom Button

    1. Open the template Row-based Report.cpt. New Calculation Engine is enabled in this template. For details, see Usage Instruction to the New Calculation Engine.

    2. Choose Template > Web Attribute > Pagination Preview Setting, and select Set for This Template Separately from the drop-down list of Following Settings, as shown in the following figure.

     6.png

    3. Add a custom button to the toolbar, and click the top toolbar editing button, as shown in the following figure.

     7.png

    4. Set Widget Alias of the custom button to Large Dataset Export, and click Custom Event, as shown in the following figure.

     8.png

    5. In the Set Callback Function window, and enter the JavaScript code, as shown in the following figure.

     9.png

    The JavaScript code is as follows:

    iconNote:
    To export the file in the Excel format, you should use exportFormat = " ",encodeFormat = " ".

    // The name of the datasets to be exported: You can use encodeURIComponent to prevent Chinese characters from garbling.
        var dsName = encodeURIComponent("ds1");
        //The exporting format: The default format is Excel if not specified.
        var exportFormat = "csv"
        //The exporting encoding type: This setting is only effective when the export format is CSV.
        var encodeFormat = "UTF - 8"
        // The server address: The IP address, port number, and web application name should be adjusted according to the actual situation.
        var url = "http://localhost:8075/webroot/decision/url/report/v10/direct/export" + "?sessionID=" + Report.SessionMgr.get() + "&dsName=" + dsName + "&exportFormat=" + exportFormat + "&encodeFormat=" + encodeFormat ;
        // The following section is for exporting the dataset as a form.
        var form = $("<form>");
        $("body").append(form);
        if (url.indexOf('?') !== -1) {
            var q = url.substr(url.indexOf('?') + 1);
            var qs = q.split('&');
            for (var i = 0; i < qs.length; i++) {
                var p = qs[i];
                var ps = p.split('=');
                if (ps.length === 2) {
                    $('<input/>').attr('name', ps[0]).val(ps[1]).appendTo(form);
                }
            }
            url = url.substring(0, url.indexOf('?'));
        } else {
            var input = $("<input>");
            form.append(input);
        }
        form.attr({"style": "display : none", "target": "", "method": "post", "action": url});
        form.submit();
        form.remove();

    Effect Display

    Save the report and click Pagination Preview. The following figure shows the effect.

     10.png

    Template Download

    For details, you can download the template: Large Dataset Export with the New Calculation Engine Enabled - Example Two.cpt

    Other Description

    Export with Parameters

    For details, you can download the template: Parameter Linkage in Drop-down Box Widgets.cpt

    If you want to export templates with parameters, you can filter parameters on the parameter panel. For details about specific settings, see Parameter Linkage Among Drop-down Boxes by SQL Statements.

    The settings of the custom button are shown in the following figure.

     11.png

    Other steps are the same as in the section "Example One: FineReport of Versions Before 11.0.10". The JavaScript code is as follows:

    // The name of the datasets to be exported: You can use encodeURIComponent to prevent Chinese characters from garbling.
        var dsName = encodeURIComponent("ds1");
        // The server address: The IP address, port number, and web application name should be adjusted according to the actual situation.
        var url = "http://localhost:8075/webroot/decision/url/report/v10/direct/export" + "?sessionID=" + Report.SessionMgr.get() + "&dsName=" + dsName + "&area=" + a + "&province=" + b + "&city=" + c ;
        // The following section is for exporting the dataset as a form.
        var form = $("<form>");
        $("body").append(form);
        if (url.indexOf('?') !== -1) {
            var q = url.substr(url.indexOf('?') + 1);
            var qs = q.split('&');
            for (var i = 0; i < qs.length; i++) {
                var p = qs[i];
                var ps = p.split('=');
                if (ps.length === 2) {
                    $('<input/>').attr('name', ps[0]).val(ps[1]).appendTo(form);
                }
            }
            url = url.substring(0, url.indexOf('?'));
        } else {
            var input = $("<input>");
            form.append(input);
        }
        form.attr({"style": "display : none", "target": "", "method": "post", "action": url});
        form.submit();
        form.remove();

    Attachment List


    Theme: Performance Optimization
    Already the First
    Already the Last
    • 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