newbie: sum (field + calc)
Ok. I give up.
I have a dbCalc that summarizes a field in a sub report. Then I need to take
that SUM and add it to a regular DBfield's value (imagine the SUM of
purchase order line items added to a static shipping charge value).
Point me in the right direction- my variables don't seem to want to play
nice----
TIA-
kathy@fishertechnical.com
I have a dbCalc that summarizes a field in a sub report. Then I need to take
that SUM and add it to a regular DBfield's value (imagine the SUM of
purchase order line items added to a static shipping charge value).
Point me in the right direction- my variables don't seem to want to play
nice----
TIA-
kathy@fishertechnical.com
This discussion has been closed.
Comments
for the variable as follows...
Value := MydbCalc.Value + MyShipChrg.Value;
HTH,
Mark
In the AfterGenerate event of the band containing the DBCalc, transfer the
value of the DBCalc to the variable:
ppVariable1.Value := ppDBCalc1.Value;
That should do it...
--
Cheers,
Tom Ollar
Digital Metaphors Corporation
http://www.digital-metaphors.com
info@digital-metaphors.com
What I have: in the Detail band, under my subreport, is the
SUM(EstExtPrice) -- totalling up the line items. Then I have the ppDBText
field named SHIPPING.
In the footer I have Variable 1 which has been assigned the SUM value,
variable 3 which has been assigned the Shipping value, and Variable 2 which
should be adding V1 + V3. The AfterGenerate code is good, but its still the
calc of (Sum + field) that hangs me up. I've only been using this a few
days, and this is the only thing I've been really stuck on. I'm sure it's
something pretty straightforward and I'm just missing it. ( oh- The
variables are all set to be dtcurrency, and I'm in professional version
ReportBuilder on D6).
***********
procedure TfrmEditPR.ppVariable2Calc(Sender: TObject; var Value: Variant);
Var
GrandTotal: Integer;
begin
//ppVariable2.Value := SHIPPING.FieldValue.asInteger;
GrandTotal := SUM(ppVariable1.value + ppVariable3.value);
end;
procedure TfrmEditPR.ppDetailBand5AfterGenerate(Sender: TObject);
var
GetShip: Integer;
begin
GetShip := Shipping.FieldValue.asString;
ppVariable1.Value := EstSUM.Value;
ppVariable3.Value := GetShip;
ppVariable2.value := SUM(ppVariable1.AsFloat+ppVariable3.AsFloat);
end;
****************