Home General

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.

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.



  • Hi Jon,

    I researched this and for the next release will add TppExportFileDialog properties

    property AdvancedFileOptionsPDF: TppAdvancedFileOptionsPDF read FAdvancedFileOptionsPDF;
    property AdvancedFileOptionsRTF: TppAdvancedFileOptionsRTF read FAdvancedFileOptionsRTF;
    property AdvancedFileOptionsXLS: TppAdvancedFileOptionsXLS read FAdvancedFileOptionsXLS;
    That will enable you to create a TmyExportFileDialog descendant class and do something like

    procedure TmyExportFileDialog.Init;

    cbxPrintToFileTypes.OnChange := cbxPrintToFileTypesChange;


    procedure TmyExportFileDialog.cbxPrintToFileTypesChange(Sender: TObject);

    inherited cbxPrintToFileTypesChange(Sender);

    // do custom logic here



    Best regards,

    Nard Moseley
    Digital Metaphors
Sign In or Register to comment.