CrossTab
Hi,
I'm using Crosstab and i need to get the subtotal value on
CalcDimensionValue event.
How can i do that?
Thanks
Veri
I'm using Crosstab and i need to get the subtotal value on
CalcDimensionValue event.
How can i do that?
Thanks
Veri
This discussion has been closed.
Comments
I'm a bit unclear about what you are trying to accomplish. The Value
returned by the CalcDimensionValue event is not the row subtotal value. You
will need to use the OnGetTotalValueText to get a total or subtotal value.
Take a look at the help for TppCrossTab and TppElement for information on
what each event does and property represents.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
thanks!
But my problem is: in my crosstab i seted two values, one to count a float
field and another to sum the same field.
So, on this field(float) i saved test?s prices. The problem is: it
calculated 1 when the price is equal zero.
To fix it, i try to detect on CalcDimensionValue event when the values is
equal 1 and set to zero if the field is zero . To do that i?m using the
follow rotine:
procedure TForm.ppSinteticCalcDimensionValue(Sender: TObject;
aDimension: TppDimension; var aValue: Variant);
var lValueDef: TppValueDef;
lValue: Variant;
begin
if not(aDimension is TppValueDef) then
Exit;
lValueDef := TppValueDef(aDimension);
if (lValueDef.CalcType = dccount) then
if (TppCrossTab(Sender).DataPipeline[name_float_field] = 0) then
aValue := 0;
end;
It?s work great, so it changed the total and subtotal values to!
How can i do to not change the total and subtotal values in this case?
Thanks!
Veri
Unfortunately once you change the aValue parameter, this value is taken into
account when the subtotal and grandtotal is calculated. If you would like
to keep the total and subtotals unchanged, you will need to update their
values manually using a similar event.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com