Consultor Eletrônico



Kbase P151699: How to create a summary field based on the results of other summaries using Infragistics controls in
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/25/2009
Status: Unverified

GOAL:

How to create a summary field based on the results of other summaries using Infragistics controls in OpenEdge 10.2x?

GOAL:

How to create a summary of summaries using .NET controls in OpenEdge Architect?

FACT(s) (Environment):

OpenEdge 10.2A
Windows

FIX:

The easiest way to achieve this is via the UltraCalcManager control. UltraCalcManager provides formula calculation functionality to controls. Using UltraCalcManager's NamedReference Collection Editor, it is possible to create new formulas based upon data in other controls used on the form, for example an UltraGrid. Once created, these formulas can be referenced in other formulas.

Example:
NamedReference "sale" uses formula: sum( [//ultraGrid1/Band 0/Sale in $] )
NamedReference "weight" uses formula: sum( [//ultraGrid1/Band 0/Weight in kg] )
NamedReference "saleweight" uses formula: [//sale] / [//weight]

The NamedReferences "sale" and "weight" are summary formulas that are created based upon columns in an UltraGrid.
NamedReference "saleweight" uses the results of the "sale" and "weight" formulas to generate its own result.

In the code, the "saleweight" formula would be referenced in the code in a manner similar to:

/* Add a new summary field with type 'Formula' */
summary3 = e:Layout:Bands[0]:Summaries:Add("saleweight", Infragistics.Win.UltraWinGrid.SummaryType:Formula, ultragrid1:DisplayLayout:Bands:Item[0]:Columns:Item["Sale/weight"]).

/* Use the "saleweight" formula */
summary3:Formula = ultraCalcManager1:NamedReferences["saleweight"]:formula.

/* Alternate use, but "sale" and "weight" NamedReferences are still required */
/* summary3:Formula = "[//Sale] / [//Weight]". */