protected void Page_Load(object sender, EventArgs e)
{
LocalReport report = new LocalReport();
report.ReportPath = "Report1.rdlc";
ReportDataSource rds = new ReportDataSource();
rds.Name = "DataSet1"; rds.Value = EmployeeRepository.GetAllEmployees();
report.DataSources.Add(rds);
Byte[] mybytes = report.Render("WORD");
using (FileStream fs = File.Create(@"D:\SalSlip.doc"))
{
fs.Write(mybytes, 0, mybytes.Length);
}
}
Reference url:http://www.codeproject.com/Articles/492739/Exporting-to-Word-PDF-using-Microsoft-Report-RDLC
No comments:
Post a Comment