예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            ReporteGeneral rpt = new ReporteGeneral();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string         fechainicial = dateFecha1.Value.Year + "/" + dateFecha1.Value.Month + "/" + dateFecha1.Value.Day;
            string         fechafinal   = dateFecha2.Value.Year + "/" + dateFecha2.Value.Month + "/" + dateFecha2.Value.Day;
            ReporteGeneral report       = new ReporteGeneral();

            report.SetDatabaseLogon("root", "123456", "localhost", "sistemav");

            ParameterValues valor1 = new ParameterValues();
            ParameterValues valor2 = new ParameterValues();



            ParameterDiscreteValue fechai = new ParameterDiscreteValue();
            ParameterDiscreteValue fechaf = new ParameterDiscreteValue();

            fechai.Value = fechainicial;
            fechaf.Value = fechafinal;

            valor1.Add(fechai);
            valor2.Add(fechaf);

            report.DataDefinition.ParameterFields["fechaInicial"].ApplyCurrentValues(valor1);
            report.DataDefinition.ParameterFields["fechaFinal"].ApplyCurrentValues(valor2);
            this.crystalReportViewer1.ReportSource = report;
        }