 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Gonzalo Torres Guest
|
Posted: Wed Feb 16, 2005 7:08 pm Post subject: Print a specific page number |
|
|
After I print a report that contains several pages, sometimes I need to
print the last page more than once.
How can I do this in code?
I don't want the user to select the printer settings in the report preview,
and manually select the page number to be printed and then print it.
|
|
| Back to top |
|
 |
Gonzalo Torres Guest
|
Posted: Wed Feb 16, 2005 8:29 pm Post subject: Re: Print a specific page number |
|
|
I have two options, but they don't work well:
1) In my AfterPrint event of my Report:
procedure TForm.QuickRepAfterPrint(Sender: TObject);
var
I : Integer;
begin
with Printer do
begin
BeginDoc;
for I := 1 to NumberOfCopies do
begin
PaintTo(Handle, 500, 500);
if I <> NumberOfCopies then
NewPage;
end;
EndDoc;
end;
end;
*********************************
2)
procedure TForm.QuickRepAfterPrint(Sender: TObject);
var
I : Integer;
begin
with QuickRep.PrinterSettings do
begin
for I := 1 to NumberOfCopies do
begin
FirstPage := 2; //If I want to print the page number 2
LastPage := 2;
Print;
end;
end;
end;
As I use master detail datasets to show the data to be printed, and when I
print the information,
it prints the report as a form, as it appears in the design mode. It doesn't
show the data, but the dbtexts.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|