cancelling a print job in Power builder

priyatharsini
priyatharsini used Ask the Experts™
on
I am using printopen(), printscreen(), printclose() inside the print function.

I know that printcancel() will cancel the print job from spool. But i don't know how to invoke it..

to be more clear, since I am using printopen(), it automatically provides me OK, cancel, setup button and I don't know how to trap the cancel clicking event..

Please help
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
You can trap the cancel event in this case.

As in the help said you must use a global variable to handle the cancel event, here's how I did in one application:

Int MyJob, i
MyJob = printopen( "Some pages to print" )


open(w_printcancel)  // Where a cancel button assign a boolean variable

for i=1 to dw_pages.RowCount()

  // check every page if cancel was clicked
  if GB_Canceled then
      PrintCancel(job)
      Exit
  end if

 dw_pages.SetFilter('page = ' + String(i) )
 dw_pages.Filter()

 dw_2.Reset()  // Same dw as dw_pages but print just 1 page at a time
 lds_pages.RowsCopy(1, 1, Primary!, dw_2, 1, Primary!)  

 PrintDataWindow(Myjob, dw_2)

next i
Top Expert 2006

Commented:
Hello priyatharsini,

This question appears to be abandoned and has been targeted for CleanUp
I  will leave a recommendation in the Cleanup topic area that this question be:

my recommendation for the moderator will be
-PAQ
-points to berXpert

-If you disagree, please post your objection here within the next seven days
-this will be finalized by an EE Moderator

PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER

HAGD:O)Bruintje
EE Cleanup Volunteer

Commented:
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial