This code snippets generate the PDF report on Button click event.For that I taken one dynamic grid then bind it into HTML code because for generating PDF we have to Make HTML code first try this I think u got solution.
protected void PrintReportButton_Click(object sender, EventArgs e)
{
#region DataGrid Bind
DataGrid grdFinal = new DataGrid();
objClientReportBL._ClientReportId = Request.QueryString["ClientReportId"].ToString();
objClientReportBL.Reportdata();
grdFinal.DataSource = objClientReportBL.ds.Tables[0];
grdFinal.DataBind();
Response.Buffer = true;
Response.ClearContent();
Response.ClearHeaders();
#endregion
#region ERROR Method
Response.ContentType = "application/vmd.pdf";
Response.AddHeader("content-disposition", "attachment;filename=ClientReport.pdf");
EnableViewState = false;
using (StringWriter sw = new StringWriter())
{
HtmlTextWriter hw = new HtmlTextWriter(sw);
grdFinal.RenderControl(hw);
Response.Write(sw.ToString());
Response.Flush();
Response.End();
}
#endregion
}