ASP.NET - how to make print preview in printing reports?

Asked By vsd on 17-Jul-13 05:34 AM
how to make preview of document(report) before print is given ? i have used xslt and xml for report display.
 kindly guide me with coding ,
Sathish S replied to vsd on 23-Jul-13 06:18 AM
use the following to apply the transformation and result xml will be in your bin path. Open up the result xml file in a browser for a preview or use and webbrowser control to open your xml file.

using System.Xml;
using System.Xml.Xsl; 

XslTransform myXslTransform;
       myXslTransform = new XslTransform();
       myXslTransform.Load("books.xsl");
       myXslTransform.Transform("books.xml", "ISBNBookList.xml");