public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { EPFETFSixMonthsRPT rpt = new EPFETFSixMonthsRPT(); rpt.Site = this.Site; return(rpt); }
private void btnETF_Click(object sender, EventArgs e) { try { if (String.IsNullOrEmpty(cmbMonth.Text)) { MessageBox.Show("Select A Time Period."); } else { Int32 intChkAll = 1; Int32 intPeriod = 1; String StrAllDiv = "%"; if (cmbMonth.Text.Equals("Jan-Jun")) { intPeriod = 1; } else { intPeriod = 2; } if (chkAll.Checked) { StrAllDiv = "%"; } else { StrAllDiv = cmbDivision.SelectedValue.ToString(); } DataSet dataSetReport = new DataSet(); dataSetReport = myReports.getETF6MonthReportData(Convert.ToInt32(cmbYear.Text), intPeriod, intChkAll, StrAllDiv); dataSetReport.WriteXml("EPFETF6MonthReportData.xml"); EPFETFSixMonthsRPT myEPFRep = new EPFETFSixMonthsRPT(); myEPFRep.SetDataSource(dataSetReport); ReportViewer myReportViewer = new ReportViewer(); myEPFRep.SetParameterValue("Estate", myEst.ListEstates().Rows[0][0].ToString() + " Estate "); if (intPeriod == 1) { myEPFRep.SetParameterValue("Period", "Returns For The Period January To June " + cmbYear.Text); } else { myEPFRep.SetParameterValue("Period", "Returns For The Period July To December " + cmbYear.Text); } myEPFRep.SetParameterValue("Title", "The Employee's Trust Fund "); myReportViewer.crystalReportViewer1.ReportSource = myEPFRep; myReportViewer.Show(); } } catch (Exception ex) { } }