contentPane

  • Last update:  2020-12-23
  • I.Overview

    ContentPane is a container for storing cpt reports. It is only in CPT, not in FRM (FRM uses _g()).

    II.Reference contentPane

    2.1 Reference in CPT

    The object can be obtained by directly using contentPane in the JS script of CPT.


    2.2 Use IFrame to Embed Reports in Webpages

    If the report is embedded in the iframe of the webpage, first get the contentWindow in the iframe, and then get the attribute contentPane object, as follows:

    var contentPane = document.getElementById('reportFrame').contentWindow.contentPane;

    III.contentPane Common Attributes

    parameterEL

    Return to the object parameter pane

    curLGP

    Return the curLGP object, only available under the report preview and decision report preview

    currentPageIndex

    The current page, only when it is paged

    reportTotalPage

    Total number of pages, only when paging

    zoom

    scaling ratio

    • Only when paging is available, it is included in the pagination preview of cpt and in the case of cpt data entry preview and __cutpage__=v data entry paging

    IV.contentPane Common Methods

    4.1 appendReportRC(num, cell)

    DescriptionInsert num row/column after the row/column where the cell is located, only in data entry mode
    Parameters
    • num: Number

      • Mandatory,rows added

    • cell: String

      • Optional,cell position the user inserted. If this parameter is not passed, the grid where the current focus is located is used

    Returnsvoid


    4.2 deleteReportRC(cell)

    DescriptionDelete num row/column after the row/column where the cell is located, only in data entry mode
    Parameters
    • cell : String

      • Optional,cell position the user deleted. If this parameter is not passed, the grid where the current focus is located is used

    Returnsvoid


    4.3 deleteRows(array)

    DescriptionDelete report records in batch
    Parameters
    • array: Array

      • Optional,array of cell strings,such as [“A1”,“A2”]

    Returnsvoid


    4.4 emailReport()

    DescriptionCall the mail sending method
    Parameters

    None

    Returnsvoid


    4.5 exportReportToExcel(format)

    DescriptionExport the report as Excel , for more details, please see the documentation (custom button to export)
    Parameters
    • format: String

      • Export format,such as "page" to illustrate paginated export xlsx

    Returnsvoid


    4.6 exportReportToImage(format)

    DescriptionExport report as image
    Parameters
    • format: String

      • image format,options: png", "jpg", "gif"

    Returnsvoid


    4.7 exportReportToPDF()

    DescriptionExport report as PDF
    Parameters

    None

    Returnsvoid


    4.8 exportReportToWord()

    DescriptionExport report as Word
    Parameters

    None

    Returnsvoid


    4.9 fireEvent(eventName)

    DescriptionFire event
    Parameters
    • eventName: String

      • event name,such as "startload", "afterload"

    ReturnsBoolean


    4.10 flashPrint()

    DescriptionFlash print the report
    Parameters

    None

    Returnsvoid


    4.11 getWidgetByName(name)

    DescriptionGet the widget in data entry mode , in the parameter pane and decision report body
    Parameters
    • name: String

      • widget name

    ReturnsFR.widget


    4.12 getWidgetByCell(cell)

    DescriptionGet the cell value, only in data entry mode
    Parameters
    • cell: String

      • Cell

    ReturnsFR.widget


    4.13 getWidgetByCell(reportIndex, columnIndex, rowIndex)

    DescriptionGet the cell value, only in data entry mode
    Parameters
    • reportIndex: Number

      • Optional,sheet number,starting from 0

    • columnIndex: Number

      • Optional,column number,starting from 0

    • rowIndex: Number

      • Optional,row number, starting from 0

    ReturnsFR.widget


    4.14 gotoFirstPage()

    DescriptionJump to the first page,only when paging
    Parameters

    None

    Returnsvoid


    4.15 gotoLastPage()

    DescriptionJump to the last page,only when paging
    Parameters

    None

    Returnsvoid


    4.16 gotoPreviousPage()

    DescriptionJump to the previous page,only when paging
    Parameters None

    Returns

    void


    4.17 gotoNextPage()

    DescriptionJump to the next page,only when paging
    Parameters

    None

    Returnsvoid


    4.18 gotoPage(pn, para, noCache)

    DescriptionJump to the specified page,only when paging,It also includes the case where the report block in the decision report is paged. It can be used to refresh the current report block.
    Parameters
    • pn: Number

      • Mandatory,page number,starting from 1

    • para: JSON

      • Optional,the parameter passed when jumping to the report block page

    • noCache: Boolean

      • Optional,force refresh when true

    Returnsvoid


    4.19 on(eventName, fn)

    DescriptionBind an event to an observer
    Parameters
    • eventName: String

      • event name

    • fn: Function

      • Execution function of the corresponding event

    Returnsvoid
    contentPane.on(FR.Events.WF, function() {alert("Submit Fail!");}); 
    //add a sumission failure event to data entry mode page

    4.20 pdfPrint()

    DescriptionPDF print
    Parameters

    None

    Returnsvoid


    4.21 printPreview()

    Description Print preview ,only when data analysis
    Parameters

    None

    Returnsvoid


    4.22 pageSetup()

    DescriptionPage setting,only when data analysis
    Parameters

    None

    Returnsvoid


    4.23 scale(zoom)

    DescriptionZoom,for details, please reference the documentation(custom button to zoom)
    Parameters
    • zoom: String

      • Zoom,zoom in is "+",zoom out is "-"

    Returnsvoid


    4.24 setWidgetByCell()

    DescriptionAssign value to cell, only in data entry mode
    Parameters
    • o: JSON

      • { reportIndex:rpIdx, //sheet number columnIndex:colIdx,//the column number of the cell

      • rowIndex:rowIdx, // the column number of the cell

      • value:cv //the value assigned to the cell }

    Returnsvoid
    contentPane.setCellValue({reportIndex:0, rowIndex:1, columnIndex:2, value:"aa"}); //Assign the value'aa' to the second row and third column of the first sheet


    4.25 setWidgetByCell(cell, null, value)

    DescriptionAssign value to the cell, only in data entry node
    Parameters
    • cell: String

      • cell

    • value: String

      • The value assigned to the cell

    Returnsvoid
    contentPane.setCellValue("C2", null, "aa"}); //assign the value 'aa' to the cell C2 in the current sheet


    4.26 setWidgetByCell(col, row, value)

    DescriptionAssign the value to the cell , only in data entry mode
    Parameters
    • col: Number

      • The column of the cell

    • row: Number

      • The row of the cell

    • value: String

      • The value assigned to the cell

    Returnsvoid
    contentPane.setCellValue(2, 1, "aa"}); //assign the value 'aa' to the second row and the third column of the sheet


    4.27 verifyReport()

    Description Data verification, only in data entry mode
    Parameters

     None

    ReturnsBoolean


    4.28 writeReport(reportIndex, submitButton, successFn, failFn)

    DescriptionSubmit the report, only in data entry mode
    Parameters
    • reportIndex: Number

      • Optional, sheet number, starting from 0

    • submitButton: Object

      • Optional, trigger button

    • successFn: Function

      • Optional, function to execute when submission succeeds

    • failFn: Function

      • Optional, function to execute when submission fails

    ReturnsBoolean
    contentPane.writeReport(0, null, function(){alert("success");}, function(){alert("fail");}); //submit the first sheet, if it succeeds, the alert is successful, and if it fails, the alert fails:contentPane.writeReport(); // submit all the sheets


    4.29 verifyAndWriteReport(isAllSheet)

    DescriptionVerification and submit the report, only in data entry mode
    Parameters
    • isAllSheet: Boolean

      • optional, submit the current sheet if empty or false , submit all sheets if true

    ReturnsBoolean


    4.30 refreshAllSheets()

    DescriptionRefresh all the sheets, and after refreshing, it will stay on the sheet page viewed last time only in data entry mode 
    Parameters

    None

    Returnsvoid


    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