public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rptLedger rpt = new rptLedger(); rpt.Site = this.Site; return(rpt); }
private void btnShow_Click(object sender, EventArgs e) { //CRTLedgerRpt oRpt = new CRTLedgerRpt(); rptLedger oRpt = new rptLedger(); ParameterFields ps = new ParameterFields(); ParameterField p = new ParameterField(); ParameterDiscreteValue pdc = new ParameterDiscreteValue(); SetDBLogonForReport(oRpt); p.Name = "@fmdate"; pdc.Value = Convert.ToDateTime(dtpFrom.Value.ToShortDateString()); p.CurrentValues.Add(pdc); ps.Add(p); ParameterField p2 = new ParameterField(); ParameterDiscreteValue pdc2 = new ParameterDiscreteValue(); p2.Name = "@todate"; pdc2.Value = Convert.ToDateTime(dtpTo.Value.ToShortDateString()); p2.CurrentValues.Add(pdc2); ps.Add(p2); ParameterField p3 = new ParameterField(); ParameterDiscreteValue pdc3 = new ParameterDiscreteValue(); p3.Name = "@accounts"; pdc3.Value = Convert.ToInt32(cmbAccount.SelectedValue); p3.CurrentValues.Add(pdc3); ps.Add(p3); crystalReportViewer1.ParameterFieldInfo = ps; crystalReportViewer1.ReportSource = oRpt; crystalReportViewer1.Show(); }