Cancelling of a Report that is Printing

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Cancelling of a Report that is Printing

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:45 pm

by Michael >> Thu, 13 Jan 2005 20:18:13 GMT

Morning All,

When you are printing you get the screen that has a "Cancel" and "Stop" button.

What I was wondering was how people handle the clicking of the "Cancel" button.

At present we check every time a frame is printed to see what the return status is. If it is anything other than Print_Successful then we return from the routine immediately. This means if you have a lot of frames then the code can get large and if you forget (or are learning the system) then a lot of wasted paper.

Doing it this way works, but I'm not sure that this is the most efficient way of doing it.

Cheers

Michael

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Cancelling of a Report that is Printing

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:45 pm

by Stephen >> Mon, 17 Jan 2005 21:06:42 GMT

We do the same thing, except the printing of a frame is all done in one method, so even if we have a huge number of frames on a report the code doesn't get any longer, and there is no risk of forgetting to put your code in. You just have to make sure that each time you print a frame you use the new method....

The method we use to print each frame also checks if the frame fits on the page, and if it doesn't then it prints a title frame if one is provided.
The method we call to print a frame is as follows:

mPrintFrame(frame, titlesFrame : Frame input) updating ;

vars
begin

if aResult <> Print_Successful then
//already an error or been canceled
return;
endif;

if not app.printer.frameFits(frame) then
app.printer.newPage ;
if titlesFrame <> null then
//print the titles again on the next page
aResult := app.printer.print(titlesFrame);
endif;
endif ;

if aResult = Print_Successful then
aResult := app.printer.print(frame) ;
endif;
epilog

end;


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 24 guests