Different XLSSettings for TppXLSXDataDevice and TppXlsxReportDevice
I needed to define different options for XLS export for the Data File and Report File exports. For example, it is useful to have IncludeSingleHeader = True for Data File exports and IncludeSingleHeader = False for Report File exports.
I initially did this using the TppReport.OnPrintDialogClose event. However, I wanted our default settings to appear in the dialog, for the dialog to update as the user changed the file type, and for the user to still have the option to override our defaults. So, I replaced that with additional code added to TppExportFileDialog.cbxPrintToFileTypesChange.
It would be nice if there was a cleaner method that I did not discover or if a cleaner method could be implemented in a future version.
Thanks
I initially did this using the TppReport.OnPrintDialogClose event. However, I wanted our default settings to appear in the dialog, for the dialog to update as the user changed the file type, and for the user to still have the option to override our defaults. So, I replaced that with additional code added to TppExportFileDialog.cbxPrintToFileTypesChange.
FAdvancedFileOptionsXLS.UpdateFileSettings(XLSSettings);
XLSSettings.IncludeSingleHeader := FileDeviceClass.InheritsFrom(TppXLSDataDevice);
FAdvancedFileOptionsXLS.InitializeOptionControls(XLSSettings);
It would be nice if there was a cleaner method that I did not discover or if a cleaner method could be implemented in a future version.
Thanks
Comments
I researched this and for the next release will add TppExportFileDialog properties That will enable you to create a TmyExportFileDialog descendant class and do something like
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com