Report Object

Sample Code - Creating a Report Object

A report corresponds to a print job in the Crystal Report Engine. When the report object is destroyed, or goes out of focus, it closes the print job. It holds on to Application Object. When a Report Object gets destroyed, it releases the application.

Access to the Report Object is dependent on the object variable you create. If the object variable goes out of scope, you will lose access to the Report Object and, therefore, the report. You may want to declare your Report Object variable as Global.

Report Object Properties

Properties Description Read/Write

Application

Returns a reference to the Application Object, that this object is associated with.

Read only

Areas

Returns Areas Collection, a collection of all the areas in the report which can be indexed by a number or by a string, such as "RH", "GF1". The areas are in the same order as on the Crystal Reports Design Tab (for example: RH, PH, GH1,...GHn, D, GFn,...GF1, RF, PF). The abbreviations for areas are case-sensitive.

Read only

Database

Returns the Database Object, which represents the database used in the report.

Read only

DialogParent
Window

Sets the parent window of report dialog boxes. If not set, the parent window is the preview window.

Write only

EventInfo

Returns EventInfo Object.

Read only

ExportOptions

Returns ExportOptions Object.

Read only

FormulaFields

Returns FormulaFieldDefinitions Collection, a collection of all the named FormulaFieldDefinitions defined in the Report.

Read only

GroupSelection
Formula

Returns/Sets the group selection formula.

Read/Write

GroupSortFields

Returns SortFields Collection, a collection of group sort fields.

Read only

HasSavedData

Returns Boolean value indicating whether report includes saved data.

Read only

LastErrorCode

Returns last error code for report-level errors.

Read only

LastErrorString

Returns last error string for report-level errors.

Read only

NumberOf
Group

Returns the number of groups in the report.

Read only

Options

Returns ReportOptions Object.

Read only

PageEngine

Returns PageEngine Object.

Read only

PageSetup

Returns PageSetup Object.

Read only

ParameterFields

Returns ParameterFieldDefinitions Collection, a collection of all the ParameterFieldDefinitions defined in the report. This property will return parameter field found in the main report as well as any subreports included in the report (that is, if the main report has 3 parameters and if a subreport included within the report has an additional 2 parameters, the number of parameter fields in the collection returned by Report.ParameterFields would be 5.

Read only

Parameter
Prompting
Enabled

Returns/Sets Boolean value indicating whether prompting dialog box for parameter field information is used.

  • If current values of all parameters are set, no prompting will occur for parameters, even if this is set to TRUE.
  • If current values of all parameters are not set, prompting will occur for parameters that need a current value if this is set to FALSE.

Read/Write

Parent

Reference to the Parent object (Application Object).

Read only

PrintDate

Returns/Sets the print date for the report. By default, the current date will be used.

Read/Write

PrinterInfo

Returns PrinterInfo Object.

Read only

PrintingStatus

Returns PrintingStatus Object.

Read only

PrintWindow
Options

Returns PrintWindowOptions Object.

Read only

ProgressDialog
Enabled

Sets Boolean value indicating whether or not to enable the progress dialog box when printing or exporting.

Write only

RecordSelection
Formula

Returns/Sets record selection formula.

Read/Write

RecordSort
Fields

Returns SortFields Collection, a collection of record sort fields.

Read only

ReportSummary
Info

Returns ReportSummaryInfo Object.

Read only

Sections

Returns Sections Collection, a collection of all the sections in the report.

Read only

SQLQuery
String

Returns/Sets the SQL query used in the report. Sample Code - SQLQueryString Property

Read/Write

SummaryFields

Returns SummaryFieldDefinitions Collection, for group and report summaries (cross-tab summaries not available when using this property).

Read only



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com