ComponentOne VSView Reporting Edition
The Overall Picture

The diagram below shows the relationship between the components in the VSView Reporting Edition package.

Boxes with a bold border represent code components (controls and applications).

Boxes with a thin border represent files containing information (report definitions, data, finished reports).

Numbered arrows indicate relationships between components, described below:

  1. Use the VSReport8 Designer to create, edit and save XML report definition files.

  2. The VSReport8 control loads report definitions from the XML files created with the Designer. This can be done at design time using the "Load Report" property page (in this case the XML file is persisted with the control and not needed at run time), or at run time using the Load method.

  3. The VSReport8 control automatically loads data from the OLEDB data source specified in the report definition file. Alternatively, you can provide your own custom recordset (ADO, DAO, or custom recordsets are supported).

  4. The VSReport8 control formats the data according to the report definition and renders reports to a VSPrinter8 control, which provides printing, previewing and export services.

  5. The VSPrinter8 control can be used to preview the report, with full document navigation, zooming, panning, and multi-page views. It can also export reports to several file formats, including HTML, PDF, VP (VSPrinter native format), and plain text.

  6. Your custom applications can communicate with the VSReport8 control using a rich object model, so you can easily customize your reports or generate entirely new ones. The VSReport8 Designer is a good example of such an application.

The object model for the VSReport8 control is summarized below. It is largely based on the Microsoft Access model, except that where Access has different types of controls (label control, textbox control, line control, etc.), VSReport8 has a single Field object with properties that can make it look like a label, textbox, line, picture, subreport, etc. The table below lists all objects, along with their main properties and methods.

 

Report Object: the VSReport8 control.

 

Render, RenderToFile, Load, Copy, Clear, GetReportInfo, DoEvents, IsBusy,Cancel, MaxPages, ReportName, Font, OnOpen, OnClose, OnNoData, OnPage, OnError, Execute, Evaluate

 

Layout Object: determines how the report will be rendered on the page.

 

Width, MarginLeft, MarginTop, MarginRight, MarginBottom, Orientation, Columns, ColumnLayout, PageHeader, PageFooter, Picture, PictureAlign, PictureShow

 

DataSource Object: manages the source recordset.

 

ConnectionString, RecordSource, Filter, MaxRecords, Recordset, FieldInfo, GetRecordSource

 

Groups Collection: a report may have many groups.

 

Group Object: controls data sorting and grouping

 

Name, GroupBy, Sort, KeepTogether, SectionHeader, SectionFooter, Move

 

Sections Collection: all reports have at least 5 sections.

 

Section Object: a container for Field objects.

 

Name, Type, Visible, Height, CanGrow, CanShrink, Repeat, KeepTogether, ForcePageBreak, BackColor, OnFormat, OnPrint

 

Fields Collection: a report usually has many Fields.

 

Field Object: a rectangular area within a section where information is displayed.

 

Name, Text, Calculated, Value, Format, Left, Top, Width, Height, Visible, Font,Align, WordWrap, BackColor, ForeColor, BorderColor, BorderStyle, LineSlant, LineWidth, CanGrow, CanShrink, MarginLeft, MarginRight, MarginTop, MarginBottom, LineSpacing, Section, ForcePageBreak, HideDuplicates, RunningSum, Picture, PictureAlign, Subreport, CheckBox, RTF

 

Every report has at least five sections, indexed as follows:

Section

Description

0 - vsrDetail

This section contains fields that are rendered once for each record in the source recordset.

1 - vsrHeader

The report header section is rendered at the beginning of the report.

2 - vsrFooter

The report footer section is rendered at the end of the report.

3 - vsrPageHeader

The page header section is rendered at the top of every page (except optionally for pages that contain the report header).

4 - vsrPageFooter

The page footer section is rendered at the bottom of every page (except optionally for pages that contain the report footer).

 

In addition to these five sections, there are two additional sections for each group: a group header and a group footer section. For example, a report with 3 grouping levels will have 11 sections.

Note that sections can be made invisible, but they cannot be added or removed (except by adding or removing groups.)

The diagram below shows how each section is rendered on a typical report:



The first section rendered is the report header. This section usually contains information that identifies the report.

After the report header comes the page header. If the report has no groups, this section usually contains labels that describe the fields in the detail section.

The next sections are the group headers, detail, and group footers. These sections contain the actual report data. Group headers and footers often contain aggregate functions such as group totals, percentages, maximum and minimum values, and so on. Group headers and footers are inserted whenever the value of the expression specified by the GroupBy property changes from one record to the next.

The detail section contains data for each record. It is possible to hide this section by setting its Visible property to False, and display only group headers and footers. This is a good way to create summary reports.

At the bottom of each page is the page footer section. This section usually contains information such as the page number, total number of pages in the report, and/or the date the report was printed.

Finally, the report footer section is printed before the last page footer. This section is often used to display summary information about the entire report.

You can determine whether or not a section is visible by setting its Visible property to True or False. Group headers can be repeated at the top of every page (whether or not it is the beginning of a group) by setting their Repeat property to True. Page headers and footers can be removed from pages that contain the report header and footer sections by setting the PageHeader and PageFooter properties on the Layout object.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback