Engine-X Large Dataset Export

  • Last update:  2022-02-18
  • I. Overview

    1. Application Scenario

    The engine-X preview can effectively solve the problem of slow template preview, but it is still relatively slow when exporting datasets.


    2. Implementation ideas

    Exporting datasets is slow, mainly because all templates need to be calculated before exporting, so as long as the engine-X supports exporting large datasets, it will be fine.

    By customizing a button on the toolbar and entering custom JS events, the export of large datasets can be realized, which can significantly improve the export speed.

    Note: This method works for cpt templates that use the engine-X.

    II. Example

    1. Custom button

    1) Open the template: %FR_HOME%\webroot\WEB-INF\reportlets\demo\NewbieGuide\line report.cpt, the template uses the new calculation engine, see the document for the method: Engine-X Usage

    2) Click Template > Web Attributes in the menu bar, and select Pagination Preview > Individually set for the template in the template Web attributes setting interface, as shown in the following figure:

    1.png

    3) Add a custom button to the toolbar, click the edit button on the top toolbar, as shown below:

    2.png

    4) Rename the custom button to Large DataSet Export, click the User Defined Event button, as shown in the following figure:

    3.png

    5) Open the event editing interface, enter the JS code, as shown in the following figure:

    4.png

    The JS code looks like this:

        var dsName = encodeURIComponent("ds1");
        var url = "http://localhost:8075/webroot/decision/url/report/v10/direct/export" + "?sessionID=" + Report.SessionMgr.get() + "&dsName=" + dsName;
        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();


    2. Effect preview

    Save the report, click the pagination preview, the export effect is as shown below:

    5.gif

    III. Template download

    The completed template can be found in: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Parameter\Engine-X DataSet Export.cpt

    Click to download the template: 

    Engine-X Large Dataset Export.cpt

    IV. Other instructions

    1. Export with parameters

    Sample template: 

    Drop-down box parameters linkage.zip

    If the template needs to be exported with parameters, the template can be filtered by the parameters in the parameter pane. For details, please refer to: Drop-down box parameter linkage

    The custom button settings are shown below:

    6.png

    Other steps are the same as in Chapter II of this article, and the code is shown in the following figure:

        var dsName = encodeURIComponent("ds1");
        var url = "http://localhost:8075/webroot/decision/url/report/v10/direct/export" + "?sessionID=" + Report.SessionMgr.get() + "&dsName=" + dsName + "&area=" + a + "&province=" + b + "&city=" + c ;
        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