/// <summary> /// Name:BtnSerach_Click /// Description:Search By Field And Display Report according to searching criteria /// Author:Monal shah /// Created Date:2010/12/13 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSerach_Click(object sender, EventArgs e) { Searchemployee obj = new Searchemployee(); SalaryDOBCrystalReport objDob = new SalaryDOBCrystalReport(); SalaryCrystalReport objSalary = new SalaryCrystalReport(); crystalReportViewer2.Visible = true; obj.SetParameterValue("Field", comboField.SelectedValue.ToString()); objDob.SetParameterValue("Field", comboField.SelectedValue.ToString()); objSalary.SetParameterValue("Field", comboField.SelectedValue.ToString()); if (textBox1.Text != string.Empty && datePickerCombo.Enabled == false && comboSalary.Enabled == false) { obj.SetParameterValue("Value", textBox1.Text.ToString() + "%"); crystalReportViewer2.ReportSource = obj; } else if (comboSalary.SelectedIndex >= 0 && comboSalary.Enabled == true) { objSalary.SetParameterValue("Equator", comboEquator.SelectedItem.ToString()); objSalary.SetParameterValue("Values", comboSalary.SelectedValue.ToString()); crystalReportViewer2.ReportSource = objSalary; } else if (datePickerCombo.Enabled == true) { objDob.SetParameterValue("Equator", comboEquator.SelectedItem.ToString()); objDob.SetParameterValue("Values", datePickerCombo.Value.Date.ToShortDateString()); crystalReportViewer2.ReportSource = objDob; } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { Searchemployee rpt = new Searchemployee(); rpt.Site = this.Site; return rpt; }