Printing dialog box

I set my data windows to "prompt before printing", and at a
print button, set a line of script.

  dw_1.print()

I run it, the print dialog appear, but when I clicked at the cancel button, it still prints the data in that data window.

I also tried with
  dw_1.print(TRUE)
it's still the same.

Anybody encounter this problem b4, please help me on this.
I am using PB 6.0 EE, pltform nt4 workstation, DB is informix

Thanks
from
sn
sn8776Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nagabalajiCommented:
Hai,

   The Cancel button is firing before u clicking. Because data transfer between datawindow and printer is fast. If the data is 10s or 100s of pages then u will see the benefit of cancel button.

The other alternative solution is give delay between pages in Datawindow->Printpage event.

0
nagabalajiCommented:
Hai,

  Use alternative. Give the facility to choose the pages which they want to print .

dw_1.Object.datawindow.Print.range = <String>

U can make the screen like microsoft printing selected range of pages.

Sample code

1 = Print all pages
2 = For selected pages.

String value is like 1,2-5; 1,3,5-9; etc.,

CHOOSE CASE ii_checked
      
      CASE 1
                id_print_dw.Print()
      CASE 2

      CASE 3
               
                String ls_page_range
                  
                   ls_page_range = sle_1.Text
                  
                   IF NOT isnull(ls_page_range) AND Len(ls_page_range) > 0 THEN  &
                        id_print_dw.Object.DataWindow.Print.Page.Range = ls_page_range
                        
          id_print_dw.Print(TRUE)
                  
                   id_print_dw.Object.DataWindow.Print.Page.Range = ""
                  
END CHOOSE
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Sybase Database

From novice to tech pro — start learning today.