public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { OutstandingRecoveriesRPT1 rpt = new OutstandingRecoveriesRPT1(); rpt.Site = this.Site; return(rpt); }
private void btnFixDisplay_Click(object sender, EventArgs e) { try { //Add by kalana String strAllDivision = "%"; String strAllDeduction = "%"; String strAllEmployee = "%"; if (!chkAllDivision.Checked) { strAllDivision = cmbDivision.SelectedValue.ToString().Trim(); } if (!chkAllEmployee.Checked) { strAllEmployee = txt_employeeNo.Text.ToString().Trim(); } if (!chkAllDeduction.Checked) { strAllDeduction = cmbDeductCode.SelectedValue.ToString().Trim(); } //Add end DataSet dataSetReport = new DataSet(); dataSetReport = myReports.getOutstandingFixedDeductions(strAllDivision.Trim(), strAllEmployee.Trim(), strAllDeduction.Trim(), 1, Convert.ToInt32(cmbDeductionGroup.SelectedValue.ToString())); dataSetReport.WriteXml("OutstandingRecoveries1.xml"); if (dataSetReport.Tables[0].Rows.Count > 0) { OutstandingRecoveriesRPT1 myaclist = new OutstandingRecoveriesRPT1(); myaclist.SetDataSource(dataSetReport); ReportViewer myReportViewer = new ReportViewer(); myaclist.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName()); if (strAllDivision == "%") { myaclist.SetParameterValue("Estate", mydiv.ListEstates().Rows[0][0].ToString() + " / Division: " + "All"); } else { myaclist.SetParameterValue("Estate", mydiv.ListEstates().Rows[0][0].ToString() + " / Division: " + strAllDivision); } myaclist.SetParameterValue("Recovery", "Fixed Deductions"); myReportViewer.crystalReportViewer1.ReportSource = myaclist; myReportViewer.Show(); } else { MessageBox.Show("No data to preview..!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }