Group variable count
I am pretty new to reports, so bear with me.
I have a detail band, its surrounded by a group header and footer. I am
trying to put a variable in the group footer so that I can display a
count of the detail records per group. I'm close but I can't figure out
the reseting part. I'm getting a cumlative count for all groups instead
of a per group count....
detail A
detail B
detail C
3
detail D
detail E
5
detail F
detail G
detail H
8
instead of
detail A
detail B
detail C
3
detail D
detail E
2
detail F
detail G
detail H
3
I created my group based on the first field in the detail band,
FullName, not sure if this is correct.
I also coded these two events
procedure TfrmMain.ppVariable1Calc(Sender: TObject; var Value: Variant);
begin
Value := IntToStr(StrToIntDef(Value,0) + 1);
end;
procedure TfrmMain.ppVariable1Reset(Sender: TObject; var Value: Variant);
begin
Value := 0;
end;
I also set the following variable properties, but I don't really know
what they should be. I've tried different values for the reset
properties, but I just don't know what to do here.
CalcComponent = ppDetailBand1
CalcType = veTraversal
ResetComponent = ppGroupFooterBand1
ResetType = veGroupEnd
Can someone give me some pointers?
srdaniel@hotmail.com
I have a detail band, its surrounded by a group header and footer. I am
trying to put a variable in the group footer so that I can display a
count of the detail records per group. I'm close but I can't figure out
the reseting part. I'm getting a cumlative count for all groups instead
of a per group count....
detail A
detail B
detail C
3
detail D
detail E
5
detail F
detail G
detail H
8
instead of
detail A
detail B
detail C
3
detail D
detail E
2
detail F
detail G
detail H
3
I created my group based on the first field in the detail band,
FullName, not sure if this is correct.
I also coded these two events
procedure TfrmMain.ppVariable1Calc(Sender: TObject; var Value: Variant);
begin
Value := IntToStr(StrToIntDef(Value,0) + 1);
end;
procedure TfrmMain.ppVariable1Reset(Sender: TObject; var Value: Variant);
begin
Value := 0;
end;
I also set the following variable properties, but I don't really know
what they should be. I've tried different values for the reset
properties, but I just don't know what to do here.
CalcComponent = ppDetailBand1
CalcType = veTraversal
ResetComponent = ppGroupFooterBand1
ResetType = veGroupEnd
Can someone give me some pointers?
srdaniel@hotmail.com
This discussion has been closed.
Comments
Makes sense I guess.