Open topic with navigation

Events

OnGroupBy - This event is always performed when breakings occurs, independently of the level, and allow the manipulation of the totalization fields. ScriptCase has all totalization variables of the grid scope. Guessing that an application which has two levels of breakings (state and city) and which totalizes two fields (parcel and balance), we can have access to the totals, in the scope of ”calculate for each register”, in the following way:

{count_ger} 

- contains the total amount of the registers;

{sum_parcel}

- contains the total sum of the field “parcel”;

{sum_balance} 

- contains the total sum of the field “balance”;

{count_state} 

- contains the total amout of the registers of the breaking of “state” which has been processed;

{sum_state_parcel}

- contains the total sum of the field “parcel” of the field of “state” which has bem processed;

{sum_state_balance} 

- contains the total sum of the field “balance” of the field of “state” which has bem processed;

{count_city} 

- contains the total amout of registers of the breaking of “city” which has been processed;

{sum_city_parcel}

- contains the total sum of the field “parcel” of the breaking of “city” which has been processed;

{sum_city_balance}

- contains the total sum of the field “balance” of the breaking of “city” which has been processed;


Considering that the formulas defined to be processed in the scope of “calculate during the breakings” will be acting for the some levels of breaking, the special variables of totalization, in this scope, they are mentioned substituting the breaking name by the key word “breaking” that means:

{count_ger}    

- contains the total amout of registers;

{sum_parcel}

- contains the total sum of the field “parcel”;

{sum_balance} 

- contains the total sum of the field “balance”;

{count_groupby}

- contains the total amount of registers, of the breaking which has been processed;

{sum_groupby_parcel}

- contains the total sum of the field “parcel” of the breaking which has been processed;

{sum_groupby_balance}

- contains the total sum of the field “balance” of the breaking which has been processed;

Ex: In an application which has breakings by state and city and which totalizes a field balance in the breakings total, we wish to show the average in substitution to the balance. It creates a method in the event OnGroupBy with the following content:

{sum_groupby_balance}= {sum_groupby_balance} / {count_groupby};