Thema: Delphi QReport und GROUP BY

Einzelnen Beitrag anzeigen

Hansa

Registriert seit: 9. Jun 2002
Ort: Saarland
7.554 Beiträge
 
Delphi 8 Professional
 
#3

Re: QReport und GROUP BY

  Alt 19. Mai 2006, 17:42
Hat das Teil eine eigene Syntax, oder wie ? Also QrExpr ? Die auszuwertenden Datenbankfelder gibt es so nicht. Es sind vorher ermittelte Rückgabewerte. Ich zitiere aus offiziellem Tuto, damit keiner groß Suchen muß :

Zitat:
Groups allow you to generate extra bands between groups of records. For example, if you were listing an address book, you might wish to group all the contacts whose name began with the same capital letter, and to print that letter in large type above each group – in fact this is what we do in the example.
To create a group:
1 Create a simple report as described in ‘A first report’ above.
2 Set the IndexName property of the TTable component to ‘ByCompany’.
3 Drop a TQRGroup component onto an existing TQuickRep object, where it appears as a new band. This band will be the group header. Every time the group ‘breaks’, this band will be printed.
4 Set the Expression property to

COPY(Table1.Company, 1, 1)

This extracts the first character from the ‘Company’ field.
5 Drop a TQRExpr control onto the header band. Set its Expression property to the same value:

COPY(Table1.Company, 1, 1)

In addition you can also add a group footer band. Although we don’t really need one here, we’ll make one for practice.
6 Select the TQRBand component on the palette and drop it on the report. Rename it to FooterBand1.
7 Click on the group header band once more. Set the TQRGroup.FooterBand property to FooterBand1.
8 Drop a TQRLabel onto the footer band. Set its Caption property to ‘FOOTER’.

If all has gone to plan, you should be looking at something like Figure 11:
Wie man sieht : die benutzen einfach Copy. Da QReport nun eine native Komponente ist, vermute ich, daß alle im Programm verfügbaren Funktionen verwendet werden können. Aber das ist eben nur Vermutung. 8)
Gruß
Hansa
  Mit Zitat antworten Zitat