コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReport8 rpt = new CrystalReport8();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
 private void button8_Click(object sender, EventArgs e)
 {
     if (comboBox2.Text != "")
     {
         if (tipoImpresion == 0)
         {
             frm_reporteVenta frm  = new frm_reporteVenta();
             CrystalReport13  cr   = new CrystalReport13();
             TextObject       text = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["sucursal"];
             text.Text = comboBox2.Text;
             cr.SetParameterValue("sucursal", comboBox2.Text);
             frm.crystalReportViewer1.ReportSource = cr;
             frm.crystalReportViewer1.RefreshReport();
             frm.ShowDialog();
         }
         else if (tipoImpresion == 1)
         {
             frm_reporteVenta frm  = new frm_reporteVenta();
             CrystalReport8   cr   = new CrystalReport8();
             TextObject       text = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["sucursal"];
             text.Text = comboBox2.Text;
             cr.SetParameterValue("sucursal", comboBox2.Text);
             frm.crystalReportViewer1.ReportSource = cr;
             frm.crystalReportViewer1.RefreshReport();
             frm.ShowDialog();
         }
         else if (tipoImpresion == 2)
         {
             frm_reporteVenta frm  = new frm_reporteVenta();
             CrystalReport19  cr   = new CrystalReport19();
             TextObject       text = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["sucursal"];
             text.Text = comboBox2.Text;
             cr.SetParameterValue("sucursal", comboBox2.Text);
             frm.crystalReportViewer1.ReportSource = cr;
             frm.crystalReportViewer1.RefreshReport();
             frm.ShowDialog();
         }
         else if (tipoImpresion == 3)
         {
             frm_reporteVenta frm  = new frm_reporteVenta();
             CrystalReport25  cr   = new CrystalReport25();
             TextObject       text = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["sucursal"];
             text.Text = comboBox2.Text;
             cr.SetParameterValue("sucursal", comboBox2.Text);
             frm.crystalReportViewer1.ReportSource = cr;
             frm.crystalReportViewer1.RefreshReport();
             frm.ShowDialog();
         }
     }
 }