WinVask -  Faktura

Basics: Step 16 (Using Total Fields)

Basics: Step 16 (Using Total Fields)

Previous topic Next topic  

Basics: Step 16 (Using Total Fields)

Previous topic Next topic  

 

A common addition to many reports (especially financial reports) is printing total fields (such as total sales) or the number of matching database entries for a group of information. This information is normally placed within a Group Footer report band, so it prints at the end of that related group of database information.

 

For this example let's assume that we want to print the total number of database record(s) for each state. This information will print at the last page of that group of information as a summary; here's how to do it:

 

ð        Create a Sorting Band on the STATE database field (if one doesn't already exist)
ð        Create a Group Footer report band (if one doesn't already exist) on the STATE database field
ð        Add a new frame inside the new Group Footer report band
ð        Click on the Dictionary button for the new Frame
ð        Underneath the 'User Variables' section of the dictionary will be an entry labeled 'Gather Totals'. Each of the Group Header / Group Footer report bands that you have defined will have an entry here titled 'Group Totals'. Highlight the entry for the STATE database field:

frb_bm106

 

ð        Click the '+' button at the top of the Dictionary dialogue window
ð        A new dialogue box appears to create a new variable based on the selected database field:

 

frb_bm107

 

As displayed above, there are many different ways of manipulating the information to be stored in the new variable. Here is a breakdown of each item:

 

ð        Assign Name: Enter the desired name of the variable here. This name MUST be unique; do NOT use the same name as the database field! An easy way of keeping the name unique is by using a prefix, such as LOC; for example, for the database field NAM:STATE a good variable name would be LOC:STATE
ð        Field/expression to total:  Use the Dictionary button to help select the database field(s) that you want to manipulate here.
ð        Picture: Define how the variable will be printed on your report by using the Picture Wizard.
ð        Total Type: Define how the selected database field(s) will be manipulated. From the droplist you can select Sum, Average, Count, Minimum, Maximum or Evaluate.
ð        Evaluate On: Define when the variable will be modified; from the droplist you can select 'At Each Record Retrieve', 'At The End Of The Group', 'At The End Of The Report' or 'At The End Of Every Page'

 

Here is the dialogue box already filled out to build the new variable:

 

frb_bm108

 

Here is how the dictionary appears after adding the new variable:

 

frb_bm109

 

And here is the modified Group Footer report band to make use of the new variable information:

 

frb_bm110

 

And an example of what the reportoutput will look like:

 

frb_bm111

 

To recap: on this page you learned:

 

ð        How to create a variable used in a Group Header / Group Footer band
ð        How to manipulate the characteristics of this new variable (e.g. it's appearance, how information is gathered from the database, etc)
ð        How to combine the Group Header / Group Footer variable with text for printing meaningful information in a report band

 

Next Tutorial Page