WinVask -  Faktura

Basics: Step 17 (Using Group Total Fields)

Basics: Step 17 (Using Group Total Fields)

Previous topic Next topic  

Basics: Step 17 (Using Group Total Fields)

Previous topic Next topic  


Printing dollar totals for a group of database information is very common in financial reports (i.e. What are the total dollar sales for all customers in a state?). The concepts described in the previous tutorial page are practically the same, with some slight changes to achieve the desired result:


ð        Create the Sorting Band on the desired database field (in this case, the STATE database field is used)
ð        Create a Group Footer band on this same database field
ð        Create a new frame inside the Group Footer band
ð        Click the Dictionary button for this newly added Frame
ð        Click the '+' button at the top of the Dictionary dialogue box
ð        Create a new variable to contain the dollar total value based on the database field containing the dollar sales (for this example it is the database field NAM:Sales):




 * NOTE *

Remember that the variable LOC:StateTotal will be containing the SUM of the NAM:Sales database field! This means that the variable will most likely be larger (potentially MUCH larger) than the largest database entry; when assigning the Picture for the variable MAKE SURE you increase it's length to accomodate this situation. Otherwise your data contained in the variable may be incorrect due to truncation!

  * NOTE *


After saving the new variable information your Dictionary screen will be updated:




And here is the Report Formatter screen after adding the variable to the report band (and formatting some text for that variable):




And some sample output:




Naturally the database field for sales for each customer could be added to the Detail report band; one could also change the Picture for the "Total Sales" to include a leading dollar sign symbol. In fact, let's also add some lines to this report band to really spruce it up:




 As shown above, the Sales information for each database record was added. Also added were a top border for the first frame (Total Records For The State) and a bottom border for the second frame (Total Sales For The State) located inside the Group Footer report band.


To recap: on this page you learned:


ð        How to create a new variable for a Group Header / Group Footer report band
ð        How to use this variable to store numeric information (such as sales information)
ð        How to combine this variable with text to print attractive and meaningful report information


Next Tutorial Page