Re: labels and quickreports
Martin <[email protected]> Tue, 04 Mar 2003 18:05:43 +1100
| Newsgroups | gmane.comp.lang.delphi.quick-reports |
|---|---|
| Message-ID | <[email protected]> |
i have had a look on the companion cd. i have managed to do what i want but
with some side effects. because what i am doing is initially disconnecting
the dataset before i preview the report. and in my OnNeedData i have this:
if giIndex < giStartLabel then
begin
Inc(giIndex, 1);
QRDBText1.Enabled := False;
QRDBText2.Enabled := False;
QRDBText3.Enabled := False;
end
else
begin
if rptLabels.DataSet = nil then rptLabels.DataSet := qryDetails;
QRDBText1.Enabled := True;
QRDBText2.Enabled := True;
QRDBText3.Enabled := True;
end;
MoreData := True;
both giIndex and giStartLabel are global variables of integer initialised
to 1, but giStartLabel will be changed depending on what is passed into the
calling procedure. which looks like this
procedure PrintLabels(piJobNo: Integer; pbPrint: Boolean; AOwner: TComponent);
var lsResult: String;
const
csSelect = 'Select * From Details Where JobNo = %d';
begin
giIndex := 1;
lsResult := InputBox(Application.Title, 'Enter Start label position', '1');
if (Trim(lsResult) <> '') and (StrToIntDef(lsResult, 0) > 0) then
giStartLabel := StrToInt(lsResult);
frmLabels := TfrmLabels.Create(AOwner);
with frmLabels do
begin
qryDetails.SQL.Text := Format(csSelect, [piJobNo]);
qryDetails.Open;
// logic to disconnect the query component from the detail until
// set number of labels has been met.
if giStartLabel > 1 then
rptLabels.DataSet := nil;
if pbPrint then
rptLabels.Print
else
rptLabels.Preview;
end;
FreeAndNil(frmLabels);
end;
then end result is that it starts at the correct position but it doesnt
reconnect the Dataset back up correctly and keeps producing labels until i
cancel the report.
At 05:14 AM 10/02/03 -0800, you wrote:
>On Mon, 10 Feb 2003 05:14:25 -0800 (PST), Martin wrote:
>On Sun, 09 Feb 2003 23:11:13 -0800 (PST), Martin wrote:
>
>Hi i've included a routine wich does this in my QReport Artist. You can
>there enter the starting etiket.
>
>What i do is that i ""copy" the detail band and disconnect the dataset of
>the report. Next i do handle the onNeedData
>event and first print X empty bands and then reconnect the original
>detailband and print the records wich need to be
>printed. If you look on the companion CD wich comes with your Delphi 7
>then you wil find QReport Artist and see how
>things work.
>
>Greetings Andre Mens
>[email protected]
>[email protected]
>
>Andre Mens
>[email protected] QReport Artist www.mensand.com
>[email protected] Easy SOAP www.rapware.com
>
>
>=============================================
>QReport Artist 5 - http://www.mensand.com/
>The new version is available for Delphi 5.0 ,
>Delphi 4.0 and Delphi 3, BC++Builder 3.0. and BC++Builder 4.0
>=============================================
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/03
----------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/03
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/LIgTpC/vN2EAA/xGHJAA/i7folB/TM
---------------------------------------------------------------------~->
=============================================
QReport Artist 5 - http://www.mensand.com/
The new version is available for Delphi 5.0 ,
Delphi 4.0 and Delphi 3, BC++Builder 3.0. and BC++Builder 4.0
=============================================
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/