Re: Quick report Master/detail problem
"ananth33" <[email protected]> Fri, 06 Sep 2002 06:50:24 -0000
| Newsgroups | gmane.comp.lang.delphi.quick-reports |
|---|---|
| Message-ID | <[email protected]> |
HI Tom Nesler,
Thx for your response.After writing code in detail band like this
procedure TFrmSTAPPReport.QRDetailBeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
if DDateEC = VarToStr( Query1.FieldByName
('LEP_COMMENCE_DATE').Value) then
QRLblDEC.Enabled := True
else
QRLblDEC.Enabled := False;
Query1.Open;
Query1.FieldByName('LEP_COMMENCE_DATE').Value := DDateEc;
end;
I am getting an error
Query1 : Cannot modify a readonly set.
Can u help me out what could be the error.
I tried like giving Query1.Close & Query1.open Even then i am getting
the same error.
Looking forward to hear from you.
TIA,
Srini
--- In quick-reports@y..., Tom Nesler <neslertom@y...> wrote:
> Hi Srini!
> --- ananth33 <ananthat2000@o...> 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