private void ProcessInvoicesSelfBilling() { progressBar1.Value = 0; var result = new ReportRepository().ContractorMonthlyReportSelfBilling(GlobalValues.Instance.CurrentMonth, GlobalValues.Instance.CurrentVatRate); panel4.Visible = true; progressBar1.Maximum = result.Rows.Count; report.LocalReport.ReportEmbeddedResource = "BitePayroll.Reports.SelfBilling.rdlc"; DataTable temp = new DataTable(); temp = result.Clone(); temp.Rows.Clear(); ReportDataSource rds = new ReportDataSource(); for (int i = 0; i < result.Rows.Count; i++) { temp.ImportRow(result.Rows[i]); rds.Value = temp; rds.Name = "SelfBilling"; report.LocalReport.DataSources.Add(rds); this.report.RefreshReport(); ExportToFile("INVOICE - " + result.Rows[i]["ContractName"] + " " + result.Rows[i]["Surname"] + ".pdf"); temp.Clear(); progressBar1.Value++; } panel4.Visible = false; result = null; }
private void ProcessInvoicesSelfBilling() { reportViewer2.LocalReport.ReportEmbeddedResource = "BitePayroll.Reports.SelfBilling.rdlc"; var result = new ReportRepository().ContractorMonthlyReportSelfBilling(165, 3); DataTable temp = new DataTable(); temp = result.Clone(); temp.Rows.Clear(); ReportDataSource rds = new ReportDataSource(); for (int i = 0; i < result.Rows.Count; i++) { temp.ImportRow(result.Rows[i]); rds.Value = temp; rds.Name = "SelfBilling"; reportViewer2.LocalReport.DataSources.Add(rds); this.reportViewer2.RefreshReport(); ExportToFile("INVOICE - " + result.Rows[i]["ContractName"] + " " + result.Rows[i]["Surname"] + ".pdf"); temp.Clear(); } }