PANTHEON™ manual

 Categories
 PANTHEON Help - Welcome
[Collapse]PANTHEON
 [Collapse]Guides for PANTHEON
  [Collapse]Guide for PANTHEON
   [Collapse]Settings
    [Expand]Subjects
    [Expand]Items
    [Expand]POS
    [Expand]Manufacturing
    [Expand]Personnel
     Calendar
    [Expand]Financials
    [Expand]Customs
    [Collapse]Program
     [Expand]Document Types
     [Collapse]Reports in PANTHEON
       Settings in Administration Panel
      [Expand]Reports Register
       Print Preview
      [Expand]Report Designer
      [Collapse]Creating Reports
        Report Objects
        "Hello, World!" Report Example
        Basic Work with Objects
        The "Text" Object
        Displaying Expressions with the Help of the "Text" Object
        Bands
        "Subject List" Report: Aliases and Variables
        "Picture" Object
        Stretching Objects, Page Breaks and Shifting Objects
        Displaying Data in the Form of a Table
        Printing Labels
        Child Bands
        Report with Two Data Levels (Master-Detail)
        Headers and Footers of a Data Band
        Multi-Page Report
      [Expand]Groups and Aggregates
      [Expand]Formatting and Highlighting
       Nested Reports (Subreports)
      [Expand]Specifics of Printouts in PANTHEON
      [Expand]Script
       Report Design Considerations
      Document Texts
      Delivery Methods
     [Expand]Loyalty Cards
     [Expand]Administration Panel
     [Expand]Dashboard Components
      Dashboard Reports
      Ad-hoc analysis
     [Expand]ARES
      SQL urejevalnik
    [Expand]Documentation
    [Expand]Change User
   [Expand]Orders
   [Expand]Goods
   [Expand]Manufacturing
   [Expand]POS
   [Expand]Service
   [Expand]Financials
   [Expand]Personnel
   [Expand]Analytics
   [Expand]Desktop
   [Expand]Help
   [Expand]Messages and Warnings
   [Expand]Additional programs
   [Expand]Old products
  [Expand]Guide for PANTHEON Retail
  [Expand]Guide for PANTHEON Vet
  [Expand]Guide for PANTHEON Farming
 [Expand]User Manuals for PANTHEON
[Expand]PANTHEON Web
[Expand]PANTHEON Granules
[Expand]User Site

Load Time: 885.8282 ms
print   |
Label

Adding a Dataset to a report

Bands

Bands are used for placing the objects they contain at particular locations on the output page.  When placing an object in the “PageHeader” band we tell the report engine that the given object must be displayed at the top of each page in the finished report. Similarly, objects in the “PageFooter” band are displayed at the bottom of each page. Let's demonstrate this with an example. We’ll create a report containing “Hello!” at the top of the page, the current date to the right of it and the page number at the foot of the page on the right hand side.

Open the designer and click the “New report” button in the toolbar. You will see a report template which already contains three bands:  “ReportTitle”, “MasterData”, and “PageFooter”. Let's remove the “MasterData” band for a while (click either on any free space inside the band or on its header and remove it with the “Delete” key or "Delete" in the context menu). Now let's add a new band (“PageHeader”). Click the “Add band” button on the object toolbar and select “PageHeader” from the drop-down list. We see that a new band is added to the page. At the same time the existing bands are moved down. Designer automatically positions bands on the page - header bands at the top, data bands in the middle and footer bands at the bottom.

Now let’s add some objects. Add a "System text" object to the "PageHeader" band and in its editor select "[DATE]" from the System variable drop-down list (you should remember that the current date can also be displayed in a "Text" object by typing "[DATE]" in its editor). Next add a “Text” object containing “Hello!” to the “ReportTitle” band. A "Text" object displaying the page number has already been automatically added to the “PageFooter” band.

Add additional "Text" objects with band type names as you see on the next picture. Set for all new objects red frame and property "Align" to "baClient". Enlarge also font size and change font text to better see band positions. Report design is on the following picture.:

When running the report you will see that the objects in the finished report are printed in the proper positions on the page.

So, bands are responsible for positioning objects on the page. Depending on the type of band, we can print objects at the top or the bottom of a page and on the first or the last page. The basic bands needed in most reports work as follows:

Band Position on page
PageHeader displayed at the very top of each page
PageFooter displayed at the very bottom of each page
ReportTitle displayed at the top of the first page - this can be before or after the "PageHeader" band, depending on the page's "TitleBeforeHeader" property (found in the object inspector after clicking on any free space on the page)
ReportSummary displayed in the free space at the very end of the report

Report consists of several bands that allow you to display values on different parts of the report. Bands are of different types and are divided into those that do not need data from tables or queries and band that need data from tables and queries.

We display the main title at the beginning of the report on "ReportTitle" band, date, page number, or comment on the "PageHeader "or on the "PageFooter" band. If you want data will be displayed at the end of the report, put them into "ReportSummary" band.

We can use bands of specified type on the report or not. We can add them via the toolbar.

The most important properties of bands are:

AllowSplit Specifies whether a band can be printed on multiple pages. If the band can not be printed on more than one page and is higher than the height of the page that is available for printing, the lower part of the band does not appear.
Stretched Specifies whether the height of the band should be adjusted to the height of the objects in it.
PrintOnFirstPage Specifies whether the band is displayed on the first page. Only page header and page footer have this property.
PrintOnLastPage Specifies whether the band the band is displayed on last page. Setting available only for page footer.
ReprintOnNewPage Specifies whether the band is displayed on the next page. Setting os available only for page header.
StartNewPage Specifies whether the band is displayed at the beginning of the next page. Setting is available for bands with dataset except group footer.

Data Bands

Now we will learn how to print data from database tables or from queries. What is considered to be a 'table' or a 'query'? They consist of data organized into lines (records or rows) which contain one or more columns (fields). To print this sort of data FastReport uses a special type of band, the various bands which are named  "...Data". To print a whole table or just some of its rows and fields, you must add one or more of these bands to the report, connect them to the table and place field objects within them. When FastReport builds the report, the bands will be printed on the output page, once for each record in the table.  If there is no free space left on the output page for a band, a new output page will be created by the report engine before continuing.

Bands that need data are:

Name Description
MasterData Data of the 1st data level repeated for each master data record. Must have DataSet defined.
GroupHeader Group title printed at the beginning of group. Condition on which field data is grouped must be defined.
GroupFooter Displayed after group.
DetailData Data of the 2nd data level repeated for each detail record.
SubdetailData Data of the 3rd data level repats once for each sub-detail record.

Adding a Dataset to the Report

To make the Delphi component (and the data connected to it) available to the report, any dataset used in the report must be enabled. Do this through the “Report>Data...” menu item in the designer, selecting the required datasets in the opened dialogue.


 



Rate this topic
Was this topic usefull?
Comments
Comment will also bo visible in forum!