//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?FromDate, DateTime?ToDate, int?CategoryId) // id để report with { ViewBag.StoreId = StoreId; ViewBag.WarehouseId = WarehouseId; ViewBag.CategoryId = CategoryId; ViewBag.FromDate = FromDate; ViewBag.ToDate = ToDate; ViewData["Report"] = new BaoCaoXuatNhapTonXtraReport(); return(PartialView()); }
private BaoCaoXuatNhapTonXtraReport CreateDateReport(int StoreId, int?WarehouseId, DateTime?FromDate, DateTime?ToDate, int?CategoryId) { BaoCaoXuatNhapTonXtraReport report = new BaoCaoXuatNhapTonXtraReport(); DataSet ds = GetData(StoreId, WarehouseId, FromDate, ToDate, CategoryId); report.DataSource = ds; // Lặp lại Detail report.DataMember = "Detail"; // Export file Name report.Name = "Báo cáo xuất nhập tồn"; return(report); }
public ActionResult ExportReportViewerPartial(int StoreId, int?WarehouseId, DateTime?FromDate, DateTime?ToDate, int?CategoryId) { BaoCaoXuatNhapTonXtraReport quarterReport = CreateDateReport(StoreId, WarehouseId, FromDate, ToDate, CategoryId); return(DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(quarterReport)); }