<< Click to Display Table of Contents >> Navigation: »No topics above this level« TOC : Script API > JavaScript > JavaScript API > GeneralScript > Page > Method >SetExcelSheetName |
Sets the sheet name, printed title, page order when you save a report to Excel.
Prototype :
void SetExcelSheetName
(
string ExcelSheetName,
[string ExcelPrintTitleRows],
[string ExcelPrintTitleColumns],
[string ExcelPageOrder]
)
Arguments :
ExcelSheetName |
excel sheet name |
ExcelPrintTitleRows |
repeated rows in the print title of the Excel file If you do not set a value, or set to an invalid value, it is applied to the empty string. It is only supported in XLSX format. |
ExcelPrintTitleColumns |
repeated columns in the print title of the Excel file If you do not set a value, or set to an invalid value, it is applied to the empty string. It is only supported in XLSX format. |
ExcelPageOrder |
refer to ExcelPageOrderConst If you do not set a value, or set to an invalid value, depending on the default page order of excel. It is only supported in XLSX format. |
Reference :
When you save a report after checking "Save page by column sheet" of Excel Save Option Dialog Box, after creating a new sheet in a page that this function is executed, and save it to a new sheet.
If the sheet name is the same as the previous page of the same column, or an empty string, this function does not work. Also, if the function called more than once on the same page, the first function that is the ExcelSheetName is not the empty string will be applied.
If the sheet name is duplicated when the new sheet created, the sequence number will be added as _1, _2, ...
If you set the ExcelPrintTitleRows, ExcelPrintTitleColumns, ExcelPageOrder differently on the same page, the first function that is the ExcelSheetName is not the empty string will be applied. But if there is no function that the ExcelSheetName is not the empty string, the value set in the first function will be applied.
If more than the maximum number of rows per one sheet and regardless of this function, the sheet is split, the sheet name is set randomly, the ExcelPrintTitleRows, ExcelPrintTitleColumns, ExcelPageOrder is applied in the same value as the previous sheet.
Example :
//input the following script in the event OnEndBind of label
var objPage = ReportTemplate.GetCurrentPage();
if(objPage != null) {
objPage.SetExcelSheetName(This.GetText(), "$1:$2", "$A:$B");
}
Available Events :
OnAddToPage, OnCheckValidity, OnClick, OnEndBind, OnFocus, OnKillFocus, OnLocationUpdated, OnValueChanged
See also :