VisionCore How To
Home Search Support Forum Knowledge Base Print

Creating Summary Totals on Custom Report

1.Every TextBox control in the designer has Summary properties. It consists of 5 properties that you can use to set the Subtotal or Grand total of a given column in your datasource.

 

SummaryTotals_01

 

Bullet PointDistinctField – A string value that represents the field name to be used as a distinct field in the summary calculation. This property is used only when the SummaryFunc value is one of Distinct Summary Functions. (i.e. DSUM, DAVG, DCOUNT)

Bullet PointSummaryFunc – Specifies the type of summarization to be performed on the field. You can use this function to create subtotals, grand totals and other summary values. SummaryFunc has no effect unless the SummaryType property is set to either SubTotal or GrandTotal.

Bullet PointSummaryGroup – The name of the group header section that is used to reset the summary value when calculating subtotals. For example, setting a sum of Price for an Order group header will reset the sum to zero for each order group. The property is only used when SummaryType is set to SummaryType.SubTotal

Bullet PointSummaryRunning – Determines the summarization behavior. Setting this property to Group or All will make ActiveReports print a running summary of the field at the group or report level. When used with Groups this property should only be set when SummaryType is GrandTotal or PageTotal, otherwise it should be set to None

Bullet PointSummaryType – Determines the type of summary to be performed.

 Bullet PointActiveReports can summarize the field as:

 

 Bullet PointSubtotal (group level; reset for each group),

 

 Bullet PointGrand total (report level; do not reset until all records are processed),

 

 Bullet PointPage total (page level; reset for each page), or a page count, which is the total number of pages printed.

 

 

If the summarized field is placed ahead of its summary level, (for example, placing a page total in the page header or a report grand total in the report header), the containing section and the following sections will not be printed until the summary value is resolved (calculated).  When using the summary functions with a field, the CanGrow and CanShrink properties are disabled for the field.

 

 

2.The next step requires some knowledge on C#. Here is a link on the basics of C#.

 http://www.functionx.com/csharp/index.htm

On the Scripts tab on the Designer, you can add C# scripts on the different Events of the different sections of the layout.

 

SummaryTotals_02

 

SummaryTotals_03

 

SummaryTotals_04

 

Once you choose a section and a corresponding event, a procedure will automatically be added. We do not recommend that you manually type off these codes; just use the standard sections and events.

 

SummaryTotals_05

 

Here is a sample code that you can use to access the contents of a specific control and transfer it to a variable.

 

SummaryTotals_06