Metareport
Keyword Index
Home




© 2004-2012 Metamatica Software

Step 4: Adding a groupband

Top  Previous  Next

 

You can make a list much more readable by dividing it into paragraphs. For example the address list can be structured by the first letter of the name. Each letter should have its own paragraph and start on a new page. To accomplish this you can use a group band:

To insert a group band, press the _bm15 button and click on your report. The group band property form will be shown, where you must set the table on which the group should work. Since we only have one table with address data, which is the main report table, the report itself must be selected as the group's "master". Now each time a record from this table is to be printed, the report engine will check the group expression and compare its result with the result of the previous record. Only if the results are not the same the group band will be printed. If you want to group our sample address table by the first letter of the company name, the expression must be "Copy(Customers.Company,1,1)" (see the chapter on expressions for more information). Leave the dialog window with OK now.

 

You have now added a group band to the report. Take a look at the report preview and you will see that the group band is inserted before each new first letter of the company name. The group band will only result in some empty space because there are no report elements on it, but you can add labels, expression fields or any other elements to the group band if you like. For example you could add an expression field with the group's expressions, so that the first letter is printed before each group of data records. The right image shows a list without grouping, the left one shows a list with such a group band:

 

_bm67

 

Continue with Step 5: Page header, title band and summary band