The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Printing a Form
Posted: 28 Oct 09 4:16 PM
|
I've created a data entry and calculation form that our users will need to print a copy of to present to their customers. What code do I need to add to the form that will allow me to print this form when the 'Print' button is clicked?
Thanks. |
|
|
|
Re: Printing a Form
Posted: 30 Oct 09 10:52 AM
|
Is any one capable of assisting me with this? Is it not possible to add a button that will allow us to print the current form?
Thanks. |
|
|
|
Re: Printing a Form
Posted: 30 Oct 09 11:02 AM
|
What level of Printing are you looking for? If all you want is print the form as displayed in the browser, you could just use Javascript. If you are looking for a "Printer Friendly format", then you need to go a bit further than just that.
For a simple print, just add a button and sets it onclick event (if adding an ASP button, use the clientclick event): "javascript:window.print();"
Otherwise (and this is what I do when tasked with printing) you would want to design a Printer Friendly format page (no controls, just nice layout for Printing) and then open it up on a separate browser. On that page you have some button for Print and Close (which you can hide during printing using CSS).....
|
|
|
|
Re: Printing a Form
Posted: 30 Oct 09 11:08 AM
|
We're using SLX v6.2.6.1007 and the form is a managed form that is at the top of the application.
How would I set it up to open in a browser?
Thanks. |
|
|
|
Re: Printing a Form
Posted: 30 Oct 09 11:33 AM
|
Sorry, I was not paying attention here, somehow I was thinking Web Client.
That being said, this is how you do it on the Windows Client:
- Create a Crystal Report that addresses the data that you have on the Form and your design layout. - Invoke the Crystal Report Programatically from a button on the form. If your are working on a Detail View, you could call the PrintDetail function, which basically calls the Report and passes the current record ID as a paramenter.
That being said, I have in the past as well used XSL and XSLT to generate an HTML Print form and then used JS to print it, but that may be an overkill.
|
|
|
|