Sunday 21 September 2014

How to Print The Current Visualforec Page with the help of JavaScript.

There is a method name is Window.print() in JavaScript.
The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.

So, In visualforce page we use this method in commandButton's onclick attribute.


<apex:commandButton onclick="window.print()" value="Print"/>


Simple and after clicking on Print button the print method prints the contents of the current Visualforce page.

No comments:

Post a Comment