GetPreferredDataSource()


" "

short GetPreferredDataSource(short SourceType, BSTR Source,
 BSTR FileName, BSTR ServerName, BSTR ObjectName)

Description

This function returns the query that should be used as a data source for a visual report.

Parameters

Name Description
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 Source parameter.
  • 2 (RSF_FILE) -- Use a visual report contained in a file. Specify the filename in the Source parameter.

Source A string containing the owner and name (Owner.Name) of the visual report.
FileName Specifies the name of the file that contains the data source. If the data source is not located in a file, then this field is an empty string.
ServerName Specifies the name of the server where the database object, that will be used as the data source, resides. If the data source is not a database object then this field is an empty string.
ObjectName Specifies the name (in the form owner.name) of a database object that will be used as the data source for this visual report. If the data source is not a database object then this field is an empty string

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

ExportVisualReport()
PrintVisualReport()