Search code examples
asp.netprintingvirtualsybasepowerbuilder

Printing in Power Builder V12 Web Application(Web Forms)


I would like to know the way of printing in Power Builder V12 Web Application(Web Forms) [Power Builder Web Application is converted to ASP.Net Web Application]

This feature is new in PowerBuilder V12 and few examples and documentation are available.

I know there is no direct way for printing as there is a need to define a virtual printer then prepare the document to be printed and send it to that printer.

If any user tried that before or has any examples for that please send them for me.

Thanks in Advance ..


Solution

  • In PB Web Forms, I've identified three ways of printing. I'm going to assume you mean printing DataWindows, as that is most common in PowerBuilder applications.

    First is to do nothing to your code and let PowerBuilder handle the DataWindow.Print() function calls. It creates UI elements to link to a "Print Manager" window which is generating PDFs for your user, which the user can then download from the Print Manager.

    Second is to leverage the DataWindow.SaveAs (..., PDF!) functionality, and calling the DownloadFile() function on your own trigger. This achieves the same ends as the first, but allows you to manage your own UI.

    Third is to show the DataWindow on a page, and use a button that calls JavaScript to fire the browser's own print command. You probably lose some formatting control with this option, but it allows an actual print function to occur instead of just a PDF generation.

    And a minor FYI, Web Forms generation from PowerBuilder has been around since version 11.0. That's about the time I started using it, which is how I came up with these options. (These things take time for me.)

    Good luck,

    Terry.