Re: Quick report Master/detail problem
Tom Nesler <[email protected]> Thu, 5 Sep 2002 14:29:53 -0700 (PDT)
| Newsgroups | gmane.comp.lang.delphi.quick-reports |
|---|---|
| Message-ID | <[email protected]> |
Hi Srini! --- ananth33 <[email protected]> wrote: > Hi There, > How are U?I am Srini from india i need ur help in this context. > This is Master detail quick report. > I have header band, QrHeader, Qrdetail and QrGroup footer bands. > And i am using single query where it will contains the master detail > records. > I am able to print master detail records.But the problem is > If a master record has got 10 child records.It is printing titles of > detail band for every child record. > How to supress this titles fo the detail band? I want to print a > master record and then all the details of that master record then > next master record in next page.I had given expression in QRGroup > correctly. > I am using oracle database(V8.1.7) > Any idea pls. > Hope you will replay me soon. To avoid duplicate data, you need to enable and disable your QRDBText components by saving the data from the previous record and comparing it to the current record. If it is the same then make the component.enabled := False; Otherwise it is true. Use the Detail band's Before Print event to put your code. Here is an example: 1. Create a global variable(s) to hold your data from the previous record. Be sure to initialize them in the QuickRep1.BeforePrint event. 2. In the Detail Band's before Print event add this kind of code: procedure TForm6.DetailBand1BeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean); begin {Check Variable for duplicate data} If CheckVar1 = Table1.FieldByName('Code').Value then QRDBTextCode.Enabled := False else QRDBTextCode.Enabled := True; Table1.FieldByName('Code').Value := CheckVar1; {Sets data up for next record check} end; Having said all that, with Proper grouping of data, into header records and detail records, you should not see much need for this kind of code if you place the duplicate data in the GroupHeader band. Hope this is what you are looking for. ===== Tom Nesler Live Long...Code Well... and Prosper! V __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com