//2. PartialView Report lại trả về action ReportViewerPartial và khởi tạo mới Report public ActionResult ReportViewerPartial(int StoreId, DateTime?FromDate, DateTime?ToDate) // id để report with { ViewBag.StoreId = StoreId; ViewBag.FromDate = FromDate; ViewBag.ToDate = ToDate; ViewData["Report"] = new BaoCaoThuChiTheoNgayXtraReport(); return(PartialView()); }
private BaoCaoThuChiTheoNgayXtraReport CreateDateReport(int StoreId, DateTime?FromDate, DateTime?ToDate) { BaoCaoThuChiTheoNgayXtraReport report = new BaoCaoThuChiTheoNgayXtraReport(); DataSet ds = GetData(StoreId, FromDate, ToDate); 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, DateTime?FromDate, DateTime?ToDate) { BaoCaoThuChiTheoNgayXtraReport quarterReport = CreateDateReport(StoreId, FromDate, ToDate); return(DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(quarterReport)); }