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)
Description
Insert 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
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
cell : String
Optional,cell position the user deleted. If this parameter is not passed, the grid where the current focus is located is used
Returns
void
4.3 deleteRows(array)
Description
Delete report records in batch
Parameters
array: Array
Optional,array of cell strings,such as [“A1”,“A2”]
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
format: String
Export format,such as "page" to illustrate paginated export xlsx
Returns
void
4.6 exportReportToImage(format)
Description
Export report as image
Parameters
format: String
image format,options: png", "jpg", "gif"
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
eventName: String
event name,such as "startload", "afterload"
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
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
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
Returns
void
4.19 on(eventName, fn)
Description
Bind an event to an observer
Parameters
eventName: String
event name
fn: Function
Execution function of the corresponding event
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
zoom: String
Zoom,zoom in is "+",zoom out is "-"
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
cell
value: String
The value assigned to the cell
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
The column of the cell
row: Number
The row of the cell
value: String
The value assigned to the cell
Returns
void
contentPane.setCellValue(2, 1, "aa"}); //assign the value 'aa' to the second row and the third column of the sheet
Optional, function to execute when submission succeeds
failFn: Function
Optional, function to execute when submission fails
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
isAllSheet: Boolean
optional, submit the current sheet if empty or false , submit all sheets if true
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
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.