FR.doURLPrint

  • Last update:  2022-01-25
  • doURLPrint(config), call out the printing tool, print the report, use get to pass the parameter, the config parameter is an object object. Format such as:

    config:{
    printUrl : String,//The application address and service of the template that needs to be printed
    isPopUp : boolean, // Whether to pop up the setting window, true is to pop up, false is not to pop up
    data :{
    [{reportlet:String, parameterN: any},{},{}...]
    }, // List of templates to print
    printType : Number, // print type, 0 is for client-side printing, 1 is for local printing
    // The following parameters are printed to zero clients, which only take effect when printType is 0
    ieQuietPrint : Boolean,//IE silent print setting true is silent, false is not silent
    // The following are the parameters for local printing, which only take effect when printType is 1
    printerName : String, // Printer name
    pageType: Number, // Print page number type: 0: all pages, 1: current page, 2: specified page
    pageIndex: String, // Page range. Valid when pageType is 2
    copy: Number, // Number of copies
    };

    Parameter Description

      ParameterInstruction
    printurlThe application address and service of the template that needs to be printed, such as"http://localhost:8075/webroot/decision/view/report"

    Empty is allowed. If empty, the current servlet address is used. If cross domain is required, this parameter cannot be empty

    isPopUp

    Whether to pop up the settings window

    • true: popup

    • false: do not pop up

    data

    List of templates to print and their parameters, JSON array

    • reportlet: template name, string, when the same template is written multiple times, multiple pages will appear when printing

    • parameterN: parameter value pair, multiple parameters are separated by commas, such as a: 'a1', b: 'b1'

    For example:

    Two templates: [{reportlet: 'name1.cpt', a: 'a1'}, {reportlet: 'name2.cpt', b: 'b1'}]  

    Leaflet template: [{reportlet: 'name.cpt', a: 'a1', b: 'b1'}]  

    printType

    print type

    • 0: Zero client printing

    • 1: local print

    The following parameters are zero-client printing parameters, which only take effect when printType is 0
    ieQuietPrint 

    IE silent printing settings

    • true: silent

    • false: not silent

    The following parameters are locally printed parameters, which only take effect when printType is 1
    printerNamePrinter name, string, such as 'Microsoft Print to PDF'
    pageType

    print page type

    • 0: all pages

    • 1: current page

    • 2: Designated page

    pageIndex

    Page number range, valid when pageType is 2, only positive integer range is supported, such as '1-3'

    copynumber of copies, number
    needSelectSheet

    Whether to print the specified Sheet page, if not, the default is false

    • true: Specifies the Sheet page

    • false: print all Sheets

    sheetIndex

    Sheet page range, only supports positive integers or positive integer ranges

    Positive integer example: 2

    Example of positive integer range: '7-10'

    Example

    Print the report GettingStartedEN.cpt under the local server http://localhost:8075/webroot/decision/view/report, the printing method is local printing, and print pages 1-3 when the parameters are East Chinaand North China respectively. 3 copies are printed.

    var printurl="http://localhost:8075/webroot/decision/view/report";
    var reportlets ="[{reportlet: 'GettingStartedEN.cpt', Region: 'North China'}, {reportlet: 
    'GettingStarted.cpt', Region: 'East China'}]"
    ;
    var config = {
    printUrl : printurl,
    isPopUp : true
    // Whether to pop up the setting window, true is to pop up, false is not to pop up
    data :{ 
    // Multiple template format: [{reportlet: 'name.cpt', a: 'a1'}, {reportlet: 'name.cpt', b: 'b1'}] The same template will appear on multiple pages
    // Single template format: [{reportlet: 'name.cpt', a: 'a1', b: 'b1'}] The same template will only have a single page
    reportlets: reportlets // List of templates to print
    },
    printType : 1// print type, 0 is for client-side printing, 1 is for local printing
    // The following parameters are printed to zero clients, which only take effect when printType is 0
    ieQuietPrint : false,// IE silent print setting true is silent, false is not silent
    // The following are the parameters for local printing, which only take effect when printType is 1
    printerName : 'Microsoft Print to PDF'// Priner name
    pageType: 2// Print page number type: 0: all pages, 1: current page, 2: specified page
    pageIndex: '1-3'// Page range. Valid when pageType is 2
    copy: 3// Number of copies
    };
    FR.doURLPrint(config);

    Attachment List


    Theme: Secondary Development
    • 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