VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Print preview using xml

Hawke  (1 Submission)   Miscellaneous   Visual Basic 5.0   Intermediate   Wed 3rd February 2021

:::An easy way to implement Print Preview:::
1. On Form Load, the ADO data control will fetch records from the database and bind to datagrid to be displayed.
2. The data control then clone a copy of the recordset and set to a local variable
3. When user selects Print Preview, the cloned recordset will be saved as an xml file to the system temp folder, with a unique file name created using CoCreateGuid API.
4. Once the xml file is created, it will be launched in the hidden Web Browser control. When the download of the xml file is completed, it will fire a download complete event, after which the print preview screen will be launched.
5. User can change the page orientation, select print type etc. via the print preview screen without using sophisticated Active X controls.
6. For additional security, the footer of the preview screen is always set to empty. This is to prevent user from locating the xml file using the printed url. The xml file is deleted each time user closes the print preview screen.

Rate Print preview using xml (7(7 Vote))

Download Print preview using xml

Print preview using xml Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters