Using Asp.net & C#.
I am generating PDF (through ITextsharp Liabrary) from Gridview, In gridview i have last three columns which is button like View,Update & Delete. I don't need that button columns is to be generate in PDF, pls give me solutions how to do this.
Thanks in advanced...
Here is my code...(.cs)
if (GridViewWorkDisciplineMaster.Rows.Count == AppConstants.EMPTY_STRING_LEN)
{
ChangeLabelColor(lblerror, "No Records Found to Export", AppConstants.BOOL_TRUE);
return;
}
else
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=WorkDisciplineMaster_" + DateTime.Now.ToString("dd/MM/yyyy") + ".pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
if (isAllDataExport == AppConstants.BOOL_TRUE)
{
BindData();
}
else if (isSearchDataExport == AppConstants.BOOL_TRUE)
{
btnSearch_Click(sender, e);
}
else if (isLikeDataExport == AppConstants.BOOL_TRUE)
{
btnLike_Click(sender, e);
}
GridViewWorkDisciplineMaster.AllowPaging = AppConstants.BOOL_FALSE;
GridViewWorkDisciplineMaster.DataBind();
GridViewWorkDisciplineMaster.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
}
And also i need to give heading like
1. name of company
2. name of report
3. print date
4. page no.
Pls help me out...
Regards,
Sumit...
xmlld ccPosted Jul 30, 2013, 2:21 AM
hi, from my experience of pdf programming with .NET ,I can share with you a pro site which provides pdf reading in ASP.NET and more tutorails regarding pdf processing using C#.VB.ASP .Detailed information for reading and editing PDF in RasterEdge Web Document Viewer is available here.This standard API will enable you to do a wide variety of ways to edit, merge, split and process batch conversion of your pdf files.
Iftikar HussainPosted Jul 14, 2013, 7:08 AM
Regards,
Iftikar
Sumit BanglorkarPosted Jul 14, 2013, 6:47 AM
Pls help me out to display name of company, name of report, print date & page no.
Sumit...
Iftikar HussainPosted Jul 14, 2013, 4:33 AM
Can you please share your aspx code?
Regards,
Iftikar