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 |
IV.contentPane Common Methods
4.1 appendReportRC(num, cell)
Description | Insert num row/column after the row/column where the cell is located, only in data entry mode |
---|
Parameters | |
---|
Returns | void |
---|
4.2 deleteReportRC(cell)
Description | Delete num row/column after the row/column where the cell is located, only in data entry mode |
---|
Parameters | |
---|
Returns | void |
---|
4.3 deleteRows(array)
Description | Delete report records in batch |
---|
Parameters | |
---|
Returns | void |
---|
4.4 emailReport()
Description | Call the mail sending method |
---|
Parameters | None |
---|
Returns | void |
---|
4.5 exportReportToExcel(format)
Description | Export the report as Excel , for more details, please see the documentation (custom button to export) |
---|
Parameters | |
---|
Returns | void |
---|
4.6 exportReportToImage(format)
Description | Export report as image |
---|
Parameters | |
---|
Returns | void |
---|
4.7 exportReportToPDF()
Description | Export report as PDF |
---|
Parameters | None |
---|
Returns | void |
---|
4.8 exportReportToWord()
Description | Export report as Word |
---|
Parameters | None |
---|
Returns | void |
---|
4.9 fireEvent(eventName)
Description | Fire event |
---|
Parameters | |
---|
Returns | Boolean |
---|
4.10 flashPrint()
Description | Flash print the report |
---|
Parameters | None |
---|
Returns | void |
---|
4.11 getWidgetByName(name)
Description | Get the widget in data entry mode , in the parameter pane and decision report body |
---|
Parameters | |
---|
Returns | FR.widget |
---|
4.12 getWidgetByCell(cell)
Description | Get the cell value, only in data entry mode |
---|
Parameters | |
---|
Returns | FR.widget |
---|
4.13 getWidgetByCell(reportIndex, columnIndex, rowIndex)
Description | Get the cell value, only in data entry mode |
---|
Parameters | reportIndex: Number columnIndex: Number rowIndex: Number
|
---|
Returns | FR.widget |
---|
4.14 gotoFirstPage()
Description | Jump to the first page,only when paging |
---|
Parameters | None |
---|
Returns | void |
---|
4.15 gotoLastPage()
Description | Jump to the last page,only when paging |
---|
Parameters | None |
---|
Returns | void |
---|
4.16 gotoPreviousPage()
Description | Jump to the previous page,only when paging |
---|
Parameters | None |
---|
Returns | void |
---|
4.17 gotoNextPage()
Description | Jump to the next page,only when paging |
---|
Parameters | None |
---|
Returns | void |
---|
4.18 gotoPage(pn, para, noCache)
Description | Jump 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 para: JSON noCache: Boolean
|
---|
Returns | void |
---|
4.19 on(eventName, fn)
Description | Bind an event to an observer |
---|
Parameters | eventName: String fn: Function
|
---|
Returns | void |
---|
contentPane.on(FR.Events.WF, function() {alert("Submit Fail!");});
//add a sumission failure event to data entry mode page
4.20 pdfPrint()
Description | PDF print |
---|
Parameters | None |
---|
Returns | void |
---|
4.21 printPreview()
Description | Print preview ,only when data analysis |
---|
Parameters | None |
---|
Returns | void |
---|
4.22 pageSetup()
Description | Page setting,only when data analysis |
---|
Parameters | None |
---|
Returns | void |
---|
4.23 scale(zoom)
Description | Zoom,for details, please reference the documentation(custom button to zoom) |
---|
Parameters | |
---|
Returns | void |
---|
4.24 setWidgetByCell()
Description | Assign 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 }
|
---|
Returns | void |
---|
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)
Description | Assign value to the cell, only in data entry node |
---|
Parameters | cell: String value: String
|
---|
Returns | void |
---|
contentPane.setCellValue("C2", null, "aa"}); //assign the value 'aa' to the cell C2 in the current sheet
4.26 setWidgetByCell(col, row, value)
Description | Assign the value to the cell , only in data entry mode |
---|
Parameters | col: Number row: Number value: String
|
---|
Returns | void |
---|
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 |
---|
Returns | Boolean |
---|
4.28 writeReport(reportIndex, submitButton, successFn, failFn)
Description | Submit the report, only in data entry mode |
---|
Parameters | reportIndex: Number submitButton: Object successFn: Function failFn: Function
|
---|
Returns | Boolean |
---|
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)
Description | Verification and submit the report, only in data entry mode |
---|
Parameters | |
---|
Returns | Boolean |
---|
4.30 refreshAllSheets()
Description | Refresh all the sheets, and after refreshing, it will stay on the sheet page viewed last time only in data entry mode |
---|
Parameters | None |
---|
Returns | void |
---|