Below is my code and after debugging its giving error
// on this line it givinng error
bytes = rptViewer1.LocalReport.Render("PDF", strDeviceInfo, out strMimeType, out strEncoding, out strExtension, out strStreams, out warnings);
DataTable dt = new DataTable();
DataSet ds = new DataSet();
ds = GetDataset(TransitionNo, TransitionType);
string FilePath = SwitchStatement(TransitionType);
byte[] bytes = null;
string strDeviceInfo = "";
string strMimeType = "";
string strEncoding = "";
string strExtension = "";
string[] strStreams = null;
Warning[] warnings = null;
try
{
ReportDataSource rds = new ReportDataSource("BusinessDetails", ds.Tables[0]);
ReportViewer rptViewer1 = new ReportViewer();
rptViewer1.LocalReport.DataSources.Clear();
rptViewer1.LocalReport.DataSources.Add(rds);
rptViewer1.ProcessingMode = ProcessingMode.Local;
rptViewer1.LocalReport.ReportPath = Server.MapPath(FilePath);
bytes = rptViewer1.LocalReport.Render("PDF", strDeviceInfo, out strMimeType, out strEncoding, out strExtension, out strStreams, out warnings);
Response.Buffer = true;
Response.Clear();
Response.ContentType = strMimeType;
Response.AddHeader("content-disposition", "attachment; filename=" + FilePath + "." + "PDF");
Response.BinaryWrite(bytes); // create the file
Response.Flush();
}// send it to the client to download
catch (Exception ex)
{
}