<< Click to Display Table of Contents >> Navigation: »No topics above this level« TOC : Script API > JavaScript > JavaScript API > GeneralScript > Page > Method >SetExportFileName |
Sets the saving format for the file to be exported and set the prefix, postfix and sub folder path of the file name for saving into multiple files.
Prototype :
void SetExportFileName
(
string ExportFileFormat,
string Prefix,
string Postfix,
[string SubFolderPath]
)
Arguments :
ExportFileFormat |
refer to ExportOptionConst multiple formats are separated by comma(".") |
Prefix |
prefix |
Postfix |
postfix |
SubFolderPath |
sub folder path |
Reference :
This function splits the current page and save into multiple files of the given format.
ExportFileFormat does not support Bankbook. And three value of ExportOptionConst, ExportOptionConst.Bankbook, ExportOptionConst.ByPrintable, ExportOptionConst.Nothing are not supported.
Prefix and Postfix can be set to the blank(""), and if set both of them to blank, no file split occurs.
If the function called more than once on the same page, the first setting will be applied.
When the export file format(JPG, PNG, GIF, etc.) is not by page, and if file names for previous page and current page are the same, the current page will be exported and appended to the end of the previous file. If the file name is different from one of the previous page but the same as one of the page previously bound, the serial number postfix(_1, _2, etc.) will be appended.
If you set the SubFolderPath argument to create a sub folder in the save path that you set in the Save dialog and then reports are saved in sub folder. To set up a multi-level sub-folders, use the "\\" or "/". Characters that can not be set as the folder name will be replaced with "_".
Example :
//string - get the current page in the OnEndBind event of a label, set the label text to postfix, export to split files only for PDF or XLS file.
var objPage = ReportTemplate.GetCurrentPage();
if(objPage != null) {
objPage.SetExportFileName("PDF,XLS", "", This.GetText());
}
//constant- get the current page in the OnEndBind event of a label, set the label text to postfix, export to split files only for PDF or XLS file.
var objPage = ReportTemplate.GetCurrentPage();
if(objPage != null) {
objPage.SetExportFileName(ExportOptionConst.PDF + "," + ExportOptionConst.XLS, "", This.GetText());
}
Available Events :
OnAddToPage, OnCheckValidity, OnClick, OnEndBind, OnFocus, OnKillFocus, OnLocationUpdated, OnValueChanged
See also :