A control to display a report on a form.

Syntax

[<oRef> =] new ReportViewer(<container> [,<name expC>])

<oRef>

A variable or property—typically of <container>—in which to store a reference to the newly created ReportViewer object.

<container>

The container—typically a Form object—to which you’re binding the ReportViewer object.

<name expC>

An optional name for the ReportViewer object. If not specified, the ReportViewer class will auto-generate a name for the object.

Properties

The following tables list the properties, events and methods of interest in the ReportViewer class.

Property

Default

Description

allowDrop

false

Whether dragged objects (normally an .REP file) can be dropped in the ReportViewer

anchor

0 – None

How the ReportViewer object is anchored in its container (0=None, 1=Bottom, 2=Top, 3=Left, 4=Right, 5=Center, 6=Container)

baseClassName

REPORTVIEWER

Identifies the object as an instance of the ReportViewer class

className

(REPORTVIEWER)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

filename

 

The name of the .REP file containing the report to view

params

 

Parameters passed to the .REP file

ref

 

A reference to the Report object being viewed

scrollBar

Auto

When a scroll bar appears for the ReportViewer object (0=Off, 1=On, 2=Auto, 3=Disabled)

 

Event

Parameters

Description

onDragEnter

<left expN>
<top expN>
<type expC>
<name expC>

When the mouse enters the ReportViewer display area during a Drag&Drop operation

onDragOver

<left expN>
<top expN>
<type expC>
<name expC>

While the mouse drags an object over the ReportViewer display area during a Drag&Drop operation

onDragLeave

 

When the mouse leaves the ReportViewer display area without having dropped an object

onDrop

<left expN>
<top expN>
<type expC>
<name expC>

 

When the mouse button is released over the ReportViewer display area during a Drag&Drop operation

onLastPage

 

When the last page of a report has been rendered in the reportViewer

Method

Parameters

Description

reExecute( )

 

Regenerates the report

 

The following table lists the common properties, events, and methods of the ReportViewer class:

Property

 

Event

Method

before
borderStyle

dragEffect

form

height

left

name
pageno

parent

systemTheme

top

width

beforeRelease
onClose

onDesignOpen
onDragBegin

onOpen

drag( )
move( )

release( )

Description

Use a ReportViewer object to view a report in a form. Assign any parameters to the params property, then set the filename property to the name of the .REP file; this executes the named report file. You may access the report object being viewed through the ref property.

If report parameters are assigned after setting the filename property, you must call the reExecute( ) method to regenerate the report.