Skip to content

pXLSExportOptions - cDRReport

Methods - Properties - Events

Obsolete

The property is obsolete per version 26. Setting PDF export options is now done via the properties

Type

drXLSExportOptions structure

Default

None

Arguments

None

Description

This write-only property must be set before exporting to XLS (ExportReport). The property should be assigned a value of the drXLSExportOptions data type.

This property cannot be set until the report OCX object is initialized. The COM object is created as part of the OpenReport method if it has not been created beforehand.

The function DefaultXLSExportOptions can be called to initialize the drXLSExportOptions variable.

Obsolete per version 26

DataFlex Framework usage

  • Web
  • Windows
  • FlexTron

Sample

Object oReport is a cDRReport
    Set psReportName to 'MyReport.dr'
End_Object

Object oExportReportButton is a Button
    Set Label to 'Export Report'

    Procedure OnClick
        drXLSExportOptions myExportOptions

        Get OpenReport Of oReport To sReportId

        // Set the export options by first getting the default options
        Get DefaultXLSExportOptions Of oReport to myExportOptions

        // Now overwrite with the desired settings
        Move C_drXLS2007 to myExportOptions.iXLSVersion
        Move C_drNoSheets to myExportOptions.iNewSheet
        Move 30 to myExportOptions.iColumnWidth
        Move False to myExportOptions.bExportDataOnly
        Move True to myExportOptions.bExportPageSections
        Move True to myExportOptions.bExportReportSections
        Move True to myExportOptions.bExportGroupSections
        Move False to myExportOptions.bAllPages
        Move 1 to myExportOptions.iPage

        // Copy the struct to the OCX via pXLSExportOptions
        Set pXLSExportOptions of oReport to myExportOptions

        // Exports the report to a file named MyReport.xlsx
        Send ExportReport of oReport C_drXLS 'c:\tmp\MyReport.xlsx'
    End_Procedure
End_Object