Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
string contentType = string.Empty;
if (ddlFileFormat.SelectedValue.Equals(".pdf"))
contentType = "application/pdf";
if (ddlFileFormat.SelectedValue.Equals(".doc"))
contentType = "application/ms-word";
if (ddlFileFormat.SelectedValue.Equals(".xls"))
contentType = "application/xls";
string empid = Session["Empid"].ToString();
DataTable dsData = new DataTable();
objOldIncBOL.EmpId = Session["Empid"].ToString();
dsData = objOldIncBLL.getdata(objOldIncBOL);
string FileName = "File_" + DateTime.Now.ToString("ddMMyyyyhhmmss") + ddlFileFormat.SelectedValue;
string extension;
string encoding;
string mimeType;
string[] streams;
Warning[] warnings;
LocalReport report = new LocalReport();
report.ReportPath = Server.MapPath("~\\UI\\OldRecords\\OldIncrementReport.rdlc");
ReportDataSource rds = new ReportDataSource();
rds.Name = "OldIncrementReport";//This refers to the dataset name in the RDLC file
rds.Value = dsData;
report.DataSources.Add(rds);
Byte[] mybytes = report.Render(ddlFileFormat.SelectedItem.Text, null,
out extension, out encoding,
out mimeType, out streams, out warnings);
Posted
Comments
virusstorm 21-Apr-15 13:48pm    
You describe in detail what you are trying to do?

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