PANTHEON™ Help

 Категории
 PANTHEON Help - Welcome
[Collapse]PANTHEON
 [Collapse]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
      [Expand]Creating Reports
      [Collapse]Groups and Aggregates
        Report with Groups
        Group Features
        Line Numbering
        Aggregate Functions
        Page and Report Totals
        Using the "SysText" Object
        Multi-Level Grouping
      [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]Logon
   [Expand]Orders
   [Expand]Goods
   [Expand]Manufacturing
   [Expand]POS
   [Expand]Service
   [Expand]Financials
   [Expand]Personnel
   [Expand]Analytics
   [Expand]Desktop
   [Expand]Помощ
   [Expand]Старите продукти
   [Expand]Messages and Warnings
   [Expand]Additional programs
  [Expand]Ръководство за PANTHEON Търговия
  [Expand]Ръководство за PANTHEON Vet
  [Expand]Ръководство за PANTHEON Фермерство
 [Collapse]PANTHEON потребителски ръководства
  [Expand]Ръководство за потребителя за PANTHEON
  [Expand]Ръководство за потребителя за PANTHEON Retail
  [Expand]Ръководство за потребителя за PANTHEON Vet
  [Expand]Ръководство за потребителя за PANTHEON Farming
[Collapse]PANTHEON Web
 [Collapse]PANTHEON Web Guides
  [Expand]Ръководство за PANTHEON Web Light
  [Expand]Ръководство за PANTHEON Уеб Терминал
  [Expand]Ръководство за PANTHEON Web Legal
  [Expand]Архив на стари продукти
 [Collapse]PANTHEON Web User Manuals
  [Expand]Започване на PANTHEON Web
  [Expand]User Manual for PANTHEON Web Light
   Ръководство за потребителя за PANTHEON Web Terminal
  [Expand]Ръководство за потребителя за PANTHEON Web Legal
  [Expand]Архив на стари продукти
[Collapse]PANTHEON Гранула
 [Collapse]Ръководство за PANTHEON Гранули
  [Expand]Гранула за служители
  [Expand]Пътни заповеди Гранула
  [Expand]Гранула за документи и задачи
  [Expand]Гранула Табло
  [Expand]Гранула за B2B поръчки
  [Expand]Гранула за обслужване на клиенти
  [Expand]Инвентаризация на дълготрайни активи
  [Expand]Гранула за складови наличности
 [Collapse]PANTHEON Granules
   Започване
   Using PANTHEON Granules at Tecta, a fictional company
  [Expand]PANTHEON Granules and activation
  [Expand]PANTHEON Granule Work records
  [Expand]PANTHEON Granule Travel orders
  [Expand]PANTHEON Granule Documents and Tasks
  [Expand]PANTHEON Granule B2B orders
  [Expand]PANTHEON Granule Dashboard
  [Expand]Полеви сервизен гранул
   PANTHEON Granules - FAQ
  [Expand]Инвентаризация на дълготрайни активи
  [Expand]Инвентаризация на склада Гранула
   Архив
[Expand]Потребителски сайт

Load Time: 453,129 ms
"
  1006269 | 218629 | 405726 | Localized
Label

Report with Groups

Report with Groups

In the previous example we constructed a two-level report based on the data from two tables. Another report which looks the same can be constructed in FastReport, this time based on a dataset obtained from a joined query.

To do this, a SQL query which returns data from both tables and sorted in a particular way is needed. In our example, the tables will be joined on the  "acSubject" field from customers and "acConsignee" field from order table. The query might be:

select *
from tHE_SetSubj, tHE_Order 
where tHE_SetSubj.acSubject = tHE_Order.acConsignee
order by tHE_SetSubj.acSubject

The "order by" line is required to sort the records on the “acSubject” (customer) field.

How can a multi-level report be designed using this data? There is a special band, the “Group Header”. A condition (a database field value or an expression) is specifeid for the band; the band is output every time the condition's value changes. The following example illustrates this.

Let's create a new project in Delphi and place “TfrxDlDBQuery” component. Set properties of new component named "DlDBQuery​1" as shown here:

SQL =

'select *
from tHE_SetSubj, tHE_Order       
where tHE_SetSubj.acSubject = tHE_Order.acConsignee
order by tHE_SetSubj.acSubject'

UserName = 'Group'

Add a “Group header” band to the report. Set a condition (in this case the “Group.acSubject” data field) in the “Group header” band editor:

Also link the data band to the “Group” data source and arrange some objects as shown (note that the group header must be placed above the data band):

The “Group header” band is output only when the field to which it is linked changes in value. Otherwise the data band connected to the “Group” dataset is displayed. If we compare this report to the master-detail report constructed earlier, it is obvious that order numbers are not sorted at all. This can be easily corrected by changing the SQL query’s 'order by' clause:

select *
from tHE_SetSubj, tHE_Order
where tHE_SetSubj.acSubject = tHE_Order.acConsignee
order by tHE_SetSubj.acSubject, tHE_Order.acKey

Reports having nested groups can be designed in a similar way. The depth of nesting of groups is unlimited. Reports which use groups have some advantages over reports of the master-detail type:

  • the whole report needs only one dataset (query)
  • the number of data grouping levels is unlimited
  • data sorting becomes possible
  • more optimal usage of the database resources (the query returns only one dataset for output, with filtering done by the query).

The only disadvantage is the need to write queries in the SQL language. However, a basic knowledge of SQL is virtually obligatory for any programmer working with databases.

 

 

Оценете темата
Темата беше ли ви полезна?
Коментар
Вашият коментар ще бъде видим и във форума!