collate problem?
I have set the report to 2 copies (pplist.PrinterSetup.Copies:=2).
I code the startpage event as:
procedure Tfrm_schdr1.pplistStartPage(Sender: TObject);
begin
inherited;
if pplist.SecondPass and (pplist.AbsolutePageNo = 1) then
Inc(FCopy);
end;
Problem:
1. If I set pplist.PrinterSetup.Collation:=false, the Startpage procedure
will do twice by the breakpoint analysis => my report is ok
2. If I set pplist.PrinterSetup.Collation:=true, the Startpage procedure
will do only once => my report is wrong.
Pls. help
Benson.
D5, RB6.03 pro
I code the startpage event as:
procedure Tfrm_schdr1.pplistStartPage(Sender: TObject);
begin
inherited;
if pplist.SecondPass and (pplist.AbsolutePageNo = 1) then
Inc(FCopy);
end;
Problem:
1. If I set pplist.PrinterSetup.Collation:=false, the Startpage procedure
will do twice by the breakpoint analysis => my report is ok
2. If I set pplist.PrinterSetup.Collation:=true, the Startpage procedure
will do only once => my report is wrong.
Pls. help
Benson.
D5, RB6.03 pro
This discussion has been closed.
Comments
I'm a bit unclear about what you are trying to accomplish with the code in
the StartPage Event. When you set Collation to True, will the report print
two copies or just one total? Try printing your report without the use of
the StartPage event and see if that works. This may be the problem area.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
print
The coding in StartPage event is referenced from
"UniqueCaptionForEachCopy.pas", which is downloaded from digital-metaphors.
Restate question again:
When I set collation to false, the Startpage procedure fires twice and the
report prints 2 copies of output with correct Fcopy value.
When I set collation to true, the Startpage procedure fires once and the
report prints 2 copies of output. But the variable FCopy=1 which cause my
report errors.
I will test it again in this area
Benson.
procedure
In my testing, turning Collation off (False) causes the Report.OnStartPage
to only fire once per page. If I turn Collation on (True) then OnStartPage
fires once for every page including the copied pages. Regardless, it is not
a good idea to be using the Report.OnStartPage event when dealing with the
printer. I would suggest trying to use the Device.StartPage event as an
alternative.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Pls. help
Benson.
You can access the TppPrintDevice from the Report.Publisher.Devices
property. From the printer device, you can assign the OnStartPage event
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
1. I cannot find ppReport.Publisher.Devices.onstartpage or
ppReport.Publisher.Devices.startpage?
2. Can I find this event in the object inspector?
3. If the event is not in the object inspector, then should I code a event
myself and assign it to ppReport.Publisher.Devices.onstartpage?
Benson.
Sorry, my mistake. To access the printer device, you first need to check in
the Report.BeforePrint that the PrinterDevice is not nil. Then you can
access it through the Report.PrinterDevice property. From here you can
assign the OnStartPage event. The TppPrinterDevice will only be created
when you print to the printer, this is why you need to check if it is nil
first.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I have code this procedure:
procedure pplistprinterDeviceStartPage(aPage: TppPage);
and then assign it to:
pplist.printerDevice.OnStartPage:=pplistprinterDeviceStartPage;
and the actual procedure:
procedure Tfrm_schdr1.pplistprinterDeviceStartPage(aPage: TppPage);
begin
if pplist.SecondPass and (pplist.AbsolutePageNo = 1) then
Inc(FCopy);
end;
Compile error:
Incompatiables type: Tobject and TppPage;
Pls. help.
Benson.
I believe the OnStartPage event needs a TObject in its declaration as the
sender for the event.
OnStartPage(Sender: TObject; aPage: TppPage);
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I have coded this procedures as follows:
procedure pplistprinterDeviceStartPage(Sender: TObject; aPage: TppPage);
procedure Tfrm_report1.pplistBeforePrint(Sender: TObject);
begin
inherited;
FCopy:=0;
if pplist.PrinterDevice<>nil then
begin
pplist.printerDevice.OnStartPage:=pplistprinterDeviceStartPage;
end;
end;
procedure Tfrm_report1pplistprinterDeviceStartPage(Sender: TObject; aPage:
TppPage);
begin
if pplist.SecondPass and (pplist.AbsolutePageNo = 1) then
Inc(FCopy);
end;
Compile error:
Incompatiables type: Tobject and TppPage;
Benson
should be TObjects.
ppListPrinterDeviceStartPage(Sender: TObject; aPage: TObject);
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com