Print template is different from preview template

  • Last update:May 10, 2021
  • I. Description

    The user system uses an iframe to embed the report. The client browser sees the report style 1. When printing, it is not the result, but style 2.

    For example, the size of the iframe of the report displayed by the user system is fixed, and the A4 paper size template cannot be displayed completely. Therefore, the report is displayed in a paging process, such as displaying 10 pieces of data per page. If you print this display result directly on A4 paper, only 10 pieces of data are displayed on each page, and the following are all blank, which is not beautiful and wastes paper, so I hope to print as normal pages when printing.

    II. Solution

    Similar to the above-mentioned situation where the printing effect is different from the report viewing effect, the unified solution is to make two templates, one corresponding to the viewed template; the other corresponding to the printed template;

    When printing, call FR's printing method through JS to print out the printing template.

    III. Implementation step

    When you click to print, call FR's printing method through JS, and use the print template to print, as follows:

    <html>
    <head>
    <script type="text/javascript" src="/webroot/decision/view/report?op=emb&resource=finereport.js"></script>
    <link rel="stylesheet" type="text/css" href="/webroot/decision/view/report?op=emb&resource=finereport.css"/>
    <script type="text/javascript">
    function doFRPrint(){  //Trigger when you click to print
    var reportURL="/webroot/decision/view/report?reportlet=report_print.cpt"; //Print the template path, which is different from the effect viewed by BS
            FR.doURLFlashPrint(reportURL);   //Call the FR printing method
    }
    </script>
    </head>
    <body>
    <div id="toolbar">
    <button type="button" onclick=doFRPrint()>Print</button>
    </div>
    <iframe id="reportFrame" src="/webroot/decision/view/report?reportlet=report.cpt&__showtoolbar__=false" width=100% height=80%></iframe>
    </body>
    </html>

    IV. Mobile

    The mobile terminal does not support various printing and exporting methods.

    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