Table of Contents

22.11.5 Report project - database table, diagram and text

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.

22.11.5.1 Section 1 - Cover

The layout of the first section ‘Cover’ is defined first. The cover page does not have a page number.

BILD 1

Figure 22.11.5.1.1: Section 1

22.11.5.2 Section 2 - Data

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.

BILD 2

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
...

22.11.5.3 Section 3 - Summary

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.

BILD 3

Figure 22.11.5.3.1: Section 3

Notes

The finished database report is impressive:

BILD 4

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.

Download

Project

Download