This chapter presents a database report project with three sections.
As it is well known that a picture can say more than a thousand words, a line diagram generated from the displayed database data is inserted into the second section as an image in the report in addition to the tabular display of the database data.
The layout of the first section ‘Cover’ is defined first. The cover page does not have a page number.
Figure 22.11.5.1.1: Section 1
The layout of the second section ‘Data’ contains a heading, a DB table and a diagram. The footer shows a reference to the page number and the number of all pages.
Figure 22.11.5.2.1: Section 2
Notes
... '-- Data from the DB table is drawn in a diagram and inserted into the report as an image. CreateChart() rImageChart.Data = $hImage rImageChart.Alignment = Align.Center rImageChart.Stretch = Report.Proportional ... Public Sub CreateChart() SetChartGeneral() SetChartType() SetChartColors() SetChartLegend() SetChartXAxis() SetChartYAxis() SetChartValues() '-- Drawing on a picture Paint.Begin($hImage) $hLineChart.Draw() Paint.End() End ...
In the summary in section 3, text from a text file is inserted into a ReportTextLabel in a TextContainer of type ReportVBox after a heading.
Figure 22.11.5.3.1: Section 3
Notes
The finished database report is impressive:
Figure 22.11.5.3.2: Database report (preview)
The complete source code for this report project is also made available to you in a project archive - including the SQLite database used.
Project