4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by sanjanaa
0

Take that two datagrid datasorce into separate datatable.

add the two datatables into one dataset.

and we can easily export the values of dataset to pdf using iTEXTSHARP library.

0

I dont have much idea about "iTEXTSHARP library".But i can suggest one more mwthod so that you get more options to choose.
Step 1:convert data set to xml
We can use DataSet.GetXml() method for that.
Convert that to string(like DataSet.GetXml() .toString())
step2:
Write an xslt script to convert the above to pdf format
step3:
Use XslCompiledTransform class and its methods Load and transform,to finally convert the xml to pddf.

-1

Hi,

You can use also PDF Duo .NET converting component in ASP.NET projects
(home page http://www.duodimension.com/html_pdf_asp.net/component_html_pdf.aspx)

The main feature of this ASP.NET component is a converting html to pdf. So you can place your datagrids, for example, inside of Panel control and then generate a PDF:

StringWriter objStringWriter = new StringWriter();
HtmlTextWriter objHTMLWriter = new HtmlTextWriter(objStringWriter);
Panel1.RenderControl(objHTMLWriter);
string html = objStringWriter.ToString();        

DuoDimension.HtmlToPdf conv = new DuoDimension.HtmlToPdf();
conv.OpenHTML(html);
conv.SavePDF(MapPath("~/Reports/") + "details.pdf");
0

Hi, Thank you so much for your reply. It works fine now.

Once again thanks a lot....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.