Solved

Count in sub detail report

Posted on 2000-03-26
8
271 Views
Last Modified: 2010-04-04
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

0
Comment
Question by:ngalt
8 Comments
 
LVL 7

Expert Comment

by:RBertora
ID: 2659980
Hi,
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;-)
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2660084
listen...
0
 

Author Comment

by:ngalt
ID: 2662444
"No" is a numeric of line. "No" is not CustNo.
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 9

Expert Comment

by:ITugay
ID: 2663173
Hi Rob,

it sound like he want to print count of subdetails in header of detail section;)

Igor.
0
 
LVL 7

Expert Comment

by:RBertora
ID: 2663277
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.QuickRep1BeforePrint(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;-)

0
 
LVL 9

Expert Comment

by:ITugay
ID: 2663471
Or place TQRSysData component into desired band. And then set it property Data = qrsDetailCount (qrsDetailNo sometimes usefull too).

Igor.
0
 
LVL 7

Expert Comment

by:RBertora
ID: 2663597
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;-)
0
 
LVL 2

Accepted Solution

by:
NetoMan earned 50 total points
ID: 2671004
If I understand your question. Just put a TQRExpr object in each band and set the expresion propery to :

   COUNT(NameofCustNoField)

and:

   COUNT(NameofOrderNoField)

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Machine not responding during CopyFile() 3 99
delphi parse string to params 3 124
select query - oracle 16 100
Firemonkey android show image from resource ? 1 42
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question