WinVask -  Faktura

Basics: Step 7 (Sorting Output)                

Basics: Step 7 (Sorting Output)                

Previous topic Next topic  

Basics: Step 7 (Sorting Output)                

Previous topic Next topic  

 

Sorting information on a report is crucial for locating information - can you imagine using your phone book if the names of everyone inside weren't sorted by last name? The Report Builder allows you to sort information how YOU want it to be sorted. Reopen the report so it is displayed in the Report Formatter screen once again.

 

The Report Builder engine uses a Sorting Band to sort data the way that you want it to. To add a Sort Band to your report to enable sorting on a database field (in this example, the last name) select BAND, then NEW, then SORTING BAND. You'll notice that the cursor changed to a pointed hand. Move the hand until the tip of the finger is on top of the word DETAIL in the detail band, then left click the mouse. Your report will now look like this:

 

frb_bm71

 

Notice that above the DETAIL band is a new entry named "Sorting Band 1", and a dialogue box titled "Sort Expression" is displayed below it; the Report Builder is asking you how to sort the database information. You will be using the dictionary to select the database field as the primary sort - click the button with the flashlight to display the dictionary onscreen:

 

frb_bm72

 

We wanted this report to be sorted on the Last Name field of the database, so we expand the "tree" for "Names Database" to display all the database field names for the database. Double left click on the Last Name database field to enter the field name into the entry field for the Sort Expression box:

 

frb_bm73

 

Notice that the database field name is now entered into the entry field; click the SAVE button. The information displayed in the Sorting Band detail is now changed to this:

 

frb_bm74

 

This let's you know how this Sorting Band will be sorting information. Go ahead and test the sort by saving the report, then exit the Report Painter screen and print a sample report. Here is what the report looks like now:

 

frb_bm75

 

Notice that the Last Name field entries are now sorted alphabetically.

 

To recap: on this page you learned:

 

ð        You control how database information is sorted on a report
ð        The report engine uses the Sorting Band to perform sorting on a database
ð        How to create a Sorting Band on a report
ð        How to select a database field from the dictionary to sort on

 

Next Tutorial Page