private void button1_Click(object sender, EventArgs e) { String strAllRoute = "%"; if (!chkRoute.Checked) { strAllRoute = cmbRoute.SelectedValue.ToString(); } string supCode = cmbSupplier.SelectedValue.ToString(); if (chkSupplier.Checked) { supCode = "%"; } String strAllDeductions = "%"; if (!chkDeduction.Checked) { strAllDeductions = cmbDeductionCode.SelectedValue.ToString(); } DataSet dataSet = myMonthlySummary.getMonthlyDeductionSummaryRoutewise(Convert.ToInt32(cmbYear.SelectedValue), Convert.ToInt32(cmbMonth.SelectedValue), supCode, strAllDeductions, strAllRoute); dataSet.WriteXml("MonthlyDeductionSummaryDC.xml"); MonthlyDeductionSummaryRWRPT myReport = new MonthlyDeductionSummaryRWRPT(); myReport.SetDataSource(dataSet); myReport.SetParameterValue("Year", cmbYear.SelectedValue.ToString()); myReport.SetParameterValue("Month", cmbMonth.Text); myReport.SetParameterValue("Company", BoughtLeafBusinessLayer.BLUser.getCompanyName()); if (chkRoute.Checked == true) { myReport.SetParameterValue("Route", "All Route"); } else { myReport.SetParameterValue("Route", cmbRoute.Text); } ReportViewer rptViewer = new ReportViewer(); rptViewer.crystalReportViewer1.ReportSource = myReport; rptViewer.Show(); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { MonthlyDeductionSummaryRWRPT rpt = new MonthlyDeductionSummaryRWRPT(); rpt.Site = this.Site; return rpt; }