public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rptVoucher_2 rpt = new rptVoucher_2(); rpt.Site = this.Site; return(rpt); }
private void frmVoucherRpt_Load(object sender, EventArgs e) { try { reports.rptVoucher_2 _rptVoucher = new reports.rptVoucher_2(); BL.BLComprobador objCnx = new BL.BLComprobador(); _rptVoucher.DataSourceConnections[0].SetConnection(objCnx.server(), objCnx.database(), objCnx.user(), objCnx.password()); _rptVoucher.SetParameterValue("@SubdiarioID", subdiarioId); _rptVoucher.SetParameterValue("@AsientoContableID", asientoContableId); _rptVoucher.SetParameterValue("@MonedaID", monedaId); _rptVoucher.SetParameterValue("@Desde", desde.ToShortDateString()); _rptVoucher.SetParameterValue("@Hasta", hasta.ToShortDateString()); _rptVoucher.SetParameterValue("@EmpresaID", empresa); _rptVoucher.SetParameterValue("@Ejercicio", periodoId); _rptVoucher.SetParameterValue("name_report", "Voucher de Diario"); _rptVoucher.SetParameterValue("date_range", desde.ToShortDateString() + " - " + hasta.ToShortDateString()); _rptVoucher.SetParameterValue("currency", "Expresado en " + moneda); _rptVoucher.SetParameterValue("empresa", RS); _rptVoucher.SetParameterValue("periodo", periodoId); _rptVoucher.SetParameterValue("ruc", "20303368877"); _rptVoucher.SetParameterValue("address", "Av. Guardia Civil #727 San Borja"); crvVoucher.ReportSource = _rptVoucher; } catch { RadMessageBox.Show("Ha ocurrido un error inesperado", "Error:", MessageBoxButtons.OK, RadMessageIcon.Error); } }