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);