ngalt
asked on
Count in sub detail report
I have a report, include detail and sub detail. I want to print a order number subdetail.
For ex.
No CustNo
No Orders
1 001
1 001
2 002
3 003
2 003
1 007
2 009
3 010
For ex.
No CustNo
No Orders
1 001
1 001
2 002
3 003
2 003
1 007
2 009
3 010
listen...
ASKER
"No" is a numeric of line. "No" is not CustNo.
Hi Rob,
it sound like he want to print count of subdetails in header of detail section;)
Igor.
it sound like he want to print count of subdetails in header of detail section;)
Igor.
Well I have no idea what he means by a subdetail.. perhaps I have a different version of quick reports.
But all bands have events :
beforeprint
afterprint
so add a qrlabel on the report where you want to display the count.
in your code
var
Mycount : integer;
procedure TForm1.QuickRep1BeforePrin t(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
Mycount := 0;
end;
headerbandBeforeprint
MyCount :=0;
DetailbandAfterPrint
Inc(MyCount);
FooterBandBeforePrint
MyQrLabel.Caption := IntToStr(MyCount);
perhaps thats not exactly perfect but that is a solid technique for printing counts.
Rob;-)
But all bands have events :
beforeprint
afterprint
so add a qrlabel on the report where you want to display the count.
in your code
var
Mycount : integer;
procedure TForm1.QuickRep1BeforePrin
var PrintReport: Boolean);
begin
Mycount := 0;
end;
headerbandBeforeprint
MyCount :=0;
DetailbandAfterPrint
Inc(MyCount);
FooterBandBeforePrint
MyQrLabel.Caption := IntToStr(MyCount);
perhaps thats not exactly perfect but that is a solid technique for printing counts.
Rob;-)
Or place TQRSysData component into desired band. And then set it property Data = qrsDetailCount (qrsDetailNo sometimes usefull too).
Igor.
Igor.
Yes Igor, I found though that if certain flags are set like reprintonnewpage etc.. sometimes qr count functions have bugs..
thus prefer to handle it myself :-)
Rob;-)
thus prefer to handle it myself :-)
Rob;-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Let me see your SQL query, I can then help you get the data in the format you require.
Right now I don't know if No (custno) is a number generated by the report, or generated by sql, similarily with that
of No(Orders)..
also when you want to print an order number, are you talking about Orders or No???
actually forget all my questions just show me your sql query, and I'll show you how to produce your output.
Rob;-)