BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Print a specific page number

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting
View previous topic :: View next topic  
Author Message
Gonzalo Torres
Guest





PostPosted: Wed Feb 16, 2005 7:08 pm    Post subject: Print a specific page number Reply with quote



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





PostPosted: Wed Feb 16, 2005 8:29 pm    Post subject: Re: Print a specific page number Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.