public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { IncentiveRPT rpt = new IncentiveRPT(); rpt.Site = this.Site; return(rpt); }
private void cmdDisplay_Click(object sender, EventArgs e) { DataSet oDataSet = new DataSet(); if (allChk.Checked) { oDataSet = oIncentives.ListIncentiveRouteWise(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString())); } else { oDataSet = oIncentives.ListIncentiveRouteWise(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), cmbRoute.SelectedValue.ToString()); } oDataSet.WriteXml("incentive.xml"); IncentiveRPT oincentiveReportPRT = new IncentiveRPT(); oincentiveReportPRT.SetDataSource(oDataSet); ReportViewer oReportViewer = new ReportViewer(); oincentiveReportPRT.SetParameterValue("Company", BoughtLeafBusinessLayer.BLUser.getCompanyName()); oincentiveReportPRT.SetParameterValue("Month", cmbMonth.Text); oincentiveReportPRT.SetParameterValue("Year", cmbYear.Text); string rte = "ALL Route"; if (allChk.Checked) { oincentiveReportPRT.SetParameterValue("Route", rte); } else { oincentiveReportPRT.SetParameterValue("Route", cmbRoute.Text); } oReportViewer.crystalReportViewer1.ReportSource = oincentiveReportPRT; oReportViewer.Show(); }