ExportVisualReport()


" "

short ExportVisualReport(long QueryID, short SourceType, BSTR Source,
 BSTR OutputFileName, BOOL SplitPages, short PageOrder, short Width, 
 short Height, short Units, BSTR PageSeparator)

Description

This function creates a visual report and writes it to an HTML file.

Parameters

Name Description
QueryID The ID of the query, as returned from InitializeQuery(). GetPreferredDataSource should be used to obtain owner and name of the query for the visual report.
SourceType The source for the visual report.

  • 1 (RSF_DATABASE) -- Use a visual report that is stored on the database. Specify the visual report owner and name (Owner.Name) in the BSTR Source parameter. To use a visual report located on a different database server, first use ExportVisualReport() to export the visual report to a file and then specify a SourceType of RSF_FILE.
  • 2 (RSF_FILE) -- Use a visual report contained in a file. Specify the filename in the BSTR Source parameter.

Source A string containing the database owner name (owner.name) or the filename of the visual report.
OutputFileName Specifies the name of the file to which you want to write the report.
SplitPages Specifies whether the report will be split into pages.
PageOrder

Controls how the visual report will be split into pages.

  • 0(RSO_EXPORT_SEPARATE_FILES) - each visual report page will be exported into separate files.
  • 1(RSO_EXPORT_ACROSS_DOWN) - a single output file contains visual report pages in "across then down" order.
  • 2(RSO_EXPORT_DOWN_ACROSS) - a single output file contains visual report pages in "down then across" order.

Width Specifies the width in Units for a Visual Report page. Zero (0) means continuous.
Height Specifies the height in Units for a Visual Report page. Zero (0) means continuous.
Units

Specifies the measurement units that are used with Width and Height.

  • 0(RSO_UNITS_CURRENT) - use units that are already specified for the visual report
  • 1(RSO_UNITS_INCHES) - inches
  • 2(RSO_UNITS_CENTIMETERS) - centimeters
  • 3(RSO_UNITS_MILLIMETERS) - millimeters
  • 4(RSO_UNITS_POINTS) - POINTS

PageSeparator Specifies a string that will be used as a page separator.

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

GetPreferredDataSource
PrintVisualReport()