See the result for
See the code to generate this sample
Line 1 When the DLL is entered initially, a dcoument
is created which sets the inside frame to be the whole page. AddFirstPage
over-rides these defaults so long as nothing has already been
added to the document. In this example both a header and a footer
are created. An artificially wide right margin is specifed in
order to demonstrate how the report is pslit across more than
Line 2 An ADO data source is accessed
Line 3 And a connection established
Line 4 A particular table is selected from the database
Line 5 A new report is commenced. At this stage it contains no
Line 6 The field definitions for Table1 are used to set up the
headers for as many columns as there are fields.
Line 7 The definition for the ID column is changed so that the
count option is used to determine the number of rows in each category.
Line 8 The Age columns is modified so that averages are calculated
Line 9 The Age column is modified to define a specific two digit
Lines 10 - 15 These lines add further modifications to the Salary
column which over-ride the defaults crerated in ReportHeaders.
Line 16 Sets the flag so that lines are drawn around the whole
Line 17 The column Type is used to group rows together and lines
are drawn under the data in each group, before the totals are
Line 18 Lines are drawn after the totals and vertical lines are
drawn between each column.
Line 19 So far the format and layout of the report have been
defined. Now the contents are printed using these specifications
by RecordsetReport. The column widths are determined by the widths
of the actual data in the recordset.
Line 20 Finally, the document is complete and, by default, EndDocument
displays the result in the preview window, allowing the user to
review it or print it as desired.