<< Click to Display Table of Contents >>
Export |
Export([ExportFilter], [ExportFileName])
Exports a Report to the file specified in the ExportFileName parameter, according to the filter specified in the ExportFilter parameter. This parameter indicates a format for exporting. The available options for the ExportFilter parameter are the following:
•PDF: Exports data to PDF (Portable Document Format) format
•Excel: Exports data to Excel's spreadsheet format
•HTML: Exports data to HTML (Hyper Text Markup Language) format
•TEXT: Exports data to Text format
•RTF: Exports data to RTF (Rich Text Format) format
•TIFF: Exports data to TIFF (Tag Image File Format) format
When informing a filter name and omitting a file name, data is exported using all properties common to each filter to a file named automatically and saved on the Domain's directory, except for HTML, TEXT, and RTF filters, where a file name must be informed. Users can modify common properties of export filters by using the GetExportFilter method before exporting data. The next script contains an example of using this method.
Sub Button1_Click()
Set report = Application.LoadReport("[Report3]")
Select case Application._
SelectMenu("PDF|Excel|HTML|TEXT|RTF|TIFF|Text(CSV)")
Case 1
Report.Export "PDF", "c:\reports\report.pdf"
MsgBox "Exported to PDF format!"
Case 2
Report.Export "Excel", "c:\reports\report.xls"
MsgBox "Exported to XLS format!"
Case 3
Report.Export "HTML", "c:\reports\report.html"
MsgBox "Exported to HTML format!"
Case 4
Report.Export "TEXT", "c:\reports\report.txt"
MsgBox "Exported to Text format!"
Case 5
Report.Export "RTF", "c:\reports\report.rtf"
MsgBox "Exported to RTF format!"
Case 6
Report.Export "TIFF", "c:\reports\report.tiff"
MsgBox "Exported to TIFF format!"
Case 7
Set reportFilter = report.GetExportFilter("TEXT")
reportFilter.FileName = "c:\reports\report2.txt"
reportFilter.TextDelimiter = ","
report.Export reportFilter
MsgBox "Exported to Text format using a filter!"
End Select
End Sub