private void btnSearch_Click(object sender, EventArgs e) { if (lblGroupName.Text != "") { string ConnectionString = ConfigurationManager.ConnectionStrings["ConString"].ConnectionString; using (SqlConnection sqlCon = new SqlConnection(ConnectionString)) try { DebitCredit_ReportNew reportDocument = new DebitCredit_ReportNew(); ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue(); paramField.Name = "@GroupId"; paramDiscreteValue.Value = cbgroupNames.SelectedValue.ToString(); paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); paramFields.Add(paramField); DebitandCreditcrystalReport.ParameterFieldInfo = paramFields; //string reportPath = Server.MapPath("~/Memberwisrrptfile.rpt"); reportDocument.Load("~/DebitCredit_ReportNew.rpt"); //reportDocument.Load(@"D:\New folder\Loanapp11sep\10092015 Loan\Loan-25-07-2015\source\LoanApplication\LoanApplication\Memberwisrrptfile.rpt"); reportDocument.SetParameterValue("@GroupId", cbgroupNames.SelectedValue.ToString()); DebitandCreditcrystalReport.ReportSource = reportDocument; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { } } else { MessageBox.Show("Please Select Group For Search"); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { DebitCredit_ReportNew rpt = new DebitCredit_ReportNew(); rpt.Site = this.Site; return rpt; }