//2. PartialView Report lại trả về action ReportViewerPartial và khởi tạo mới Report public ActionResult ReportViewerPartial(int StoreId, int?WarehouseId, DateTime?Date, int?CategoryId) // id để report with { ViewBag.StoreId = StoreId; ViewBag.WarehouseId = WarehouseId; ViewBag.CategoryId = CategoryId; ViewBag.Date = Date; ViewData["Report"] = new BaoCaoTonKhoOnHandXtraReport(); return(PartialView()); }
private BaoCaoTonKhoOnHandXtraReport CreateDateReport(int StoreId, int?WarehouseId, DateTime?Date, int?CategoryId) { BaoCaoTonKhoOnHandXtraReport report = new BaoCaoTonKhoOnHandXtraReport(); DataSet ds = GetData(StoreId, WarehouseId, Date, CategoryId); report.DataSource = ds; // Lặp lại Detail report.DataMember = "Detail"; // Export file Name report.Name = "Báo cáo tồn kho"; return(report); }
public ActionResult ExportReportViewerPartial(int StoreId, int?WarehouseId, DateTime?Date, int?CategoryId) { BaoCaoTonKhoOnHandXtraReport quarterReport = CreateDateReport(StoreId, WarehouseId, Date, CategoryId); return(DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(quarterReport)); }