Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 the source of report definition has not been speci
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ali100
Starting Member

5 Posts

Posted - 10/18/2012 :  08:23:11  Show Profile  Reply with Quote
ReportViewer ReportViewer1 =null;

ReportPath = "Reports/BatchOtherComments.rdlc";

rptData.DataSetName = "spReport_LoanSummaryBatchOther";
objReportDataSource = new ReportDataSource("spReport_LoanSummaryBatchOther", rptData.Tables[0]);
//ReportViewer1.LocalReport.ReportPath = "Reports/BatchOtherComments.rdlc";
rep.DataSources.Add(objReportDataSource);
// ReportViewer1.LocalReport.ReportEmbeddedResource = "Reports/BatchOtherComments.rdlc";
// byte[] rdlbytes = System.Text.Encoding.UTF8.GetBytes("Reports/rptDeniedLoansDetails.rdlc");
//MemoryStream stream = new MemoryStream(rdlbytes);
//ReportViewer1.LocalReport.LoadReportDefinition(stream);


Warning[] warnings;
string mimeType;
string encoding;
string extension;
string deviceInfo;
string[] streamids;
deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>PDF</OutputFormat>" +
" <PageSize>A4</PageSize>" +
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.25in</MarginTop>" +
" <MarginLeft>0.25in</MarginLeft>" +
" <MarginRight>0.25in</MarginRight>" +
" <MarginBottom>0.25in</MarginBottom>" +
"</DeviceInfo>";
byte[] bytes = ReportViewer1.ServerReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);
FileStream fs = new FileStream(@"C:/Users/wnaeem/Sample.PDF", FileMode.Create);
fs.Write(bytes, 0, bytes.Length);
fs.Close();

}
}
catch (Exception ex)
{
throw ;

}
finally
{
ReportViewer1.Dispose();
}
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000