Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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)
{
}
Posted
Comments
ZurdoDev 5-Sep-13 7:13am    
And the error is?
thatraja 10-Sep-13 7:33am    
what's the error? Someone(RyanDev) asked you 5 days ago & still you're answering

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900