Hi Teams,
I don’t know the reason i don’t export to excel file.
This is code in my class
WorkbookDesigner wbdesigner;
try
{
wbdesigner = new WorkbookDesigner();
wbdesigner.Open(path);
wbdesigner.ClearDataSource();
foreach (DataTable item in objTable)
{
wbdesigner.SetDataSource(item);
}
wbdesigner.Process();
//save workbook
wbdesigner.Workbook.Save(HttpContext.Current.Response, SaveFormat.Excel97To2003, ContentDisposition.Inline);
}
catch
{
}
This is code in controller
ExportReport export = new ExportReport();
DataTable Detail = new DataTable();
var data = db.PO_REQUESTDETAIL.Where(n => n.DocEntry == docEntry).ToList();
Detail = Global.ConvertToDataTable(data);
DataTable dtRpt1 = new DataTable();
dtRpt1 = Detail;
dtRpt1.TableName = "Detail";
DataTable[] arrTable = { dtRpt1 };
export.Export2Excel(Server.MapPath("~/RptTemplate/rptPO_RequestDetail.xls"), arrTable, "rptPO_RequestDetail.xls");