public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { MonthlyBankSummaryRPT rpt = new MonthlyBankSummaryRPT(); rpt.Site = this.Site; return(rpt); }
private void cmdDisplay_Click(object sender, EventArgs e) { try { DataSet dataSetReport = new DataSet(); BoughtLeafBusinessLayer.Reports myReports = new BoughtLeafBusinessLayer.Reports(); dataSetReport = myReports.getBankPaymentSummary(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString())); dataSetReport.WriteXml("BankPayments.xml"); MonthlyBankSummaryRPT myaclist = new MonthlyBankSummaryRPT(); myaclist.SetDataSource(dataSetReport); ReportViewer myReportViewer = new ReportViewer(); myaclist.SetParameterValue("Company", BoughtLeafBusinessLayer.BLUser.getCompanyName()); myaclist.SetParameterValue("Period", "Period : " + cmbYear.Text + " / " + cmbMonth.Text); myReportViewer.crystalReportViewer1.ReportSource = myaclist; myReportViewer.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }