short ExportReport(long QueryID, short SourceType, BSTR Source, BSTR OutputFileName, short PageLength, short PageWidth, Boolean IncludeDateTime, Boolean IncludePageNumbers, [VARIANT Format], [VARIANT UseFormPageSetup])
Description
This function creates a report for the query and writes it to a file. You define the formatting and layout for the report in a QMF form. The output file is an ASCII text file. A pair of carriage returns and line feed characters separates each line. A form-feed character separates each page. It is best to view the output file using a fixed-pitch font.
Parameters
Name | Description |
---|---|
QueryID | The ID of the query, as returned from InitializeQuery(). |
SourceType |
Use one of the following to specify the source of the form:
|
Source | The name (filename or Owner.Name) of the form that you want to use. |
OutputFileName | The name of the file to which you want to write the report. |
PageLength | The number of lines on each page of the report. A PageLength of negative one (-1) specifies continuous output. That means there are no page breaks unless the report is wider than PageWidth. |
PageWidth | The number of characters on each line of the report. A PageWidth of negative one (-1) specifies continuous output That means the lines are made just long enough to contain the full width of the report. |
IncludeDateTime | Non-zero specifies that the date and time are included at the bottom of each page. Zero specifies that the date and time are not included. |
IncludePageNumbers | Non-zero specifies that page numbers are included at the bottom of each page. Zero specifies that page numbers are not included. |
Format |
Optionally, specifies the format of the exported report.
With non-HTML forms, the output is converted to HTML by adding HTML tags at
the beginning and end of the output. The default value is zero.
|
UseFormPageSetup | Optionally, a non-zero for this parameter will ignore the parameters for PageLength, PageWidth, IncludeDateTime, and IncludePageNumbers in this API call. Instead, their values will be taken from the form. |
Return Value
The return value will be zero if successful or non-zero if unsuccessful. If the return value is non-zero, you can call GetLastErrorString(), GetLastErrorType(), GetLastSQLCode(), GetLastSQLError(), or GetLastSQLState() to get additional error information.
Related Tasks