PrintReportEx()


" "

short PrintReportEx(long QueryID, short SourceType, BSTR Source, BSTR PrinterName, 
BOOLEAN UseFormPageSetup, short PageLength, short PageWidth, BOOLEAN IncludeDateTime, 
BOOLEAN IncludePageNumbers, BOOLEAN HTMLFormat, BSTR JobTitle, BSTR FontName, short FontSize, 
BOOLEAN FontBold, BOOLEAN FontItalic, short FontCharSet, short TopMargin, short BottomMargin, 
short LeftMargin, short RightMargin, short Orientation, short NumCopies)

Description

This function prints a copy of a report.

Parameters

Name Description
QueryID The ID of the query, as returned from InitializeQuery().
SourceType The source for the form.

  • 0 (RSF_DEFAULT) -- Use the default form. FormName should be an empty string.
  • 1 (RSF_DATABASE) -- Use a form from the database. Specify the form owner and name (Owner.Name) in the FormName parameter. To use a form located on a different database server, first use ExportForm() to export the form to a file and then specify a SourceType of RSF_FILE.
  • 2 (RSF_FILE) -- Use the form contained in a file. Specify the filename in the FormName parameter.

Source A string containing the SQL text, the owner and name (Owner.Name) of the query, or the name of a file containing SQL text.
PrinterName Specifies the name of the printer on which to print the report.
UseFormPageSetup Non-zero specifies that the PageLength, PageWidth, IncludeDateTime, and IncludePageNumbers parameters should be ignored and their and values should be taken from the specified form. The default value is zero.
PageLength The number of lines on each page of the report. A PageLength of negative one (-1) specifies continuous output (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 (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.
JobTitle Specifies the name of the print job as it will be displayed in Print Manager.
FontCharSet Specifies the character set to use when printing the object.
TopMargin Specifies the top margin of the printed report.
BottomMargin Specifies the bottom margin of the printed report.
LeftMargin Specifies the left margin of the printed report.
RightMargin Specifies the right margin of the printed report.
Orientation Specifies the paper orientation of the printed report.
NumCopies Specifies the number of copies to print when printing the report.

Return Value

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

ExportForm()