6.7.3  Running Total

Walkthrough

A 'Running Total' has much in common with a summary field. The difference is that a 'Running Total' can be maintained independently of any predefined grouping characteristics. You can use running totals to show how a field increments row by row, or apply a formula to a value irrespective of the grouping and summarization.

Consider the following example:

1. Click the 'New' button in the Style Studio toolbar. This opens the 'New Asset' dialog box.

2. In the left panel, select the 'Report' node. In the right 'Types' panel, select 'Blank Tabular Report' and click 'OK'

3. Expand the Style Studio Toolbox panel.

4. Click the 'Section' button in the Toolbox panel to open the 'Data Binding' dialog box for a new Section.

5. Under the Data tab, select the 'Order Model' data model from the 'Orders' data source. Under the Columns tab, select the following columns:

'Customer.Company'
'Product.Name'
'Product.QuantityPurchased'
'Product.Price'
'Product.Description'
'Order.Discount'

6. Under the Grouping & Summary tab, group on the 'Customer.Company' field, and summarize on the 'Product.Price' field.

7. Click 'Finish'.

A 'Running Total' can also be used with a summarized table.

8. Create space for the new running total column:

a. Rename the header fields as follows:
'Product.Quantity Purchased' > 'Quantity'
'Product.Name' > 'Product'
'Customer.Company' > 'Company'
'Product.Price' > 'Price'
'Product.Description' > 'Description'
'Order.Discount' > 'Discount'

b. Move the existing header and content fields to the left to create empty space on the right side of the section.

c. In the space you created, add a text element in the header with text “Running Total”.

To do this, right-click the Section, and choose 'Insert' > 'Basic Element' > 'Text' from the context menu. Then click in the Header band with the crosshair to place the Text element in the desired location.

4. Define the running total by following the steps below:

a. Right-click the Section, and choose 'Insert' > 'Special Field' > 'Running Total' from the context menu. This opens the 'Running Total' dialog box.

 

b. In the 'Running Total' dialog box, click the 'New' button. This opens the 'Running Total Property' dialog box.

To edit the running total at a later time, click the 'Running Total' button in the Toolbox panel. This opens the 'Running Total' dialog box. Click 'Edit' to modify an existing running measure.

c. In the 'Running Total Name' field, enter “running_price”.

d. In the 'Data Element' menu, select “Section1”. This is the report element with which the running total should be associated.

e. From the 'Summary Field' menu, select 'Product.Price'. Set 'Sum' as the formula.

(Optional) In the 'Evaluate' panel, you can choose 'For each record' to evaluate the running total increment for each record. Choose 'On change of' to evaluate the running total increment at each group change. Similar options are available to reset the running total.

f. Click 'OK'. The running total is now listed in the 'Running Total' dialog box.

 

g. Click to select the 'running_price' measure, and click 'OK'. The pointer now turns into a crosshair.

8. Click with the crosshair in the Detail band under the 'Running Total' header. This adds the running total to the Detail band. Resize and format the Text element as desired.

 

9. Preview the report.

 

<< Section Options for a Freehand Section © 1996-2013 InetSoft Technology Corporation (v11.4) 6.7.4 Subreports >>