public void Fill(object sender, RoutedEventArgs e) { this.reportViewer.Reset(); Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource(); Data.PurchaseDS PurchaseDB = new Data.PurchaseDS(); PurchaseDB.BeginInit(); Data.PurchaseDSTableAdapters.PurchaseTenderSummaryTableAdapter PurchaseTenderSummaryTableAdapter = new Data.PurchaseDSTableAdapters.PurchaseTenderSummaryTableAdapter(); DataTable dt = new DataTable(); dt = PurchaseTenderSummaryTableAdapter.GetDataByDates(ReportPanel.StartDate, ReportPanel.EndDate, CurrentSession.Id_Company); reportDataSource1.Name = "PurchaseTenderSummary"; //Name of the report dataset in our .RDLC file reportDataSource1.Value = dt; //SalesDB.SalesByDate; this.reportViewer.LocalReport.DataSources.Add(reportDataSource1); this.reportViewer.LocalReport.ReportEmbeddedResource = "Cognitivo.Reporting.Reports.PurchaseTenderSummary.rdlc"; PurchaseDB.EndInit(); this.reportViewer.Refresh(); this.reportViewer.RefreshReport(); }
public void Fill(object sender, RoutedEventArgs e) { this.reportViewer.Reset(); Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource(); Data.PurchaseDS PurchaseDB = new Data.PurchaseDS(); PurchaseDB.BeginInit(); Data.PurchaseDSTableAdapters.PurchaseOrderSummaryTableAdapter PurchaseOrderSummaryTableAdapter = new Data.PurchaseDSTableAdapters.PurchaseOrderSummaryTableAdapter(); DataTable dt = new DataTable(); if (ReportPanel.Branch != null) { dt = PurchaseOrderSummaryTableAdapter.GetDataByBranch(ReportPanel.StartDate, ReportPanel.EndDate, ReportPanel.Branch.id_branch); } else { dt = PurchaseOrderSummaryTableAdapter.GetDataBy(ReportPanel.StartDate, ReportPanel.EndDate); } //ReportParameter[] parameters = new ReportParameter[x+1]; reportDataSource1.Name = "PurchaseOrderSummary"; //Name of the report dataset in our .RDLC file reportDataSource1.Value = dt; //SalesDB.SalesByDate; this.reportViewer.LocalReport.DataSources.Add(reportDataSource1); this.reportViewer.LocalReport.ReportEmbeddedResource = "Cognitivo.Reporting.Reports.PurchaseOrderSummary.rdlc"; //parameters[0] = new ReportParameter("name1", value1); //parameters[0] = new ReportParameter("name1", value1); //parameters[0] = new ReportParameter("name1", value1); //parameters[0] = new ReportParameter("name1", value1); //parameters[0] = new ReportParameter("name1", value1); //this.reportViewer.LocalReport.SetParameters("EndDate", dtEndDate, false); PurchaseDB.EndInit(); this.reportViewer.Refresh(); this.reportViewer.RefreshReport(); }