.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Convert to PDF/Excel

Posted By: Pawan kumar Shukla     Posted Date: June 20, 2011    Points:5   Category :ASP.Net
can anyone tell me how to convert any datatable/dataview or any data to be converted in PDF or Excel. think it use Pdf-Sharp/Mgradoc.dll but i can't be able to use the same way i like to

Help plz
Thanks

Responses
Author: Gowthammanju             
Posted Date: June 20, 2011     Points: 20   

EXPORT EXCEL FROM DATA VIEW



use below coding u may find solution


protected void Button1_Click(object sender, EventArgs e)
{
Response.Clear();

Response.AddHeader("content-disposition", "attachment; filename=FileName1.xls");

Response.Charset = "";

Response.ContentType = "application/vnd.xls";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter htmlWrite =
new HtmlTextWriter(stringWrite);

GridView g = new GridView();
g.DataSource = SqlDataSource1;
g.DataBind();

g.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());

Response.End();

}




Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Gowthammanju             
Posted Date: June 21, 2011     Points: 20   

Ply Find Attachment


it solves ur problem



Download Attachment

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: arronlee             
Posted Date: August 19, 2015     Points: 20   

How about converting PDF with the help of some 3rd party PDF converters?
( http://www.pqscan.com/convert-pdf/ )

Next Tomorrow is Another Day .


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend