Beispiel #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReport9 rpt = new CrystalReport9();

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
        private void contruyeCotizacionCliente()
        {
            DataSetVenta ds = new DataSetVenta();

            for (int i = 0; i < dataGridView1.RowCount; i++)
            {
                ds.Tables[0].Rows.Add
                    (new object[]
                {
                    dataGridView1[2, i].Value.ToString(),
                    dataGridView1[1, i].Value.ToString(),
                    dataGridView1[3, i].Value.ToString(),
                    dataGridView1[5, i].Value.ToString()
                });
            }
            frm_reporteVenta frm = new frm_reporteVenta();
            CrystalReport9   cr  = new CrystalReport9();

            cr.SetDataSource(ds);
            TextObject text = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["numero"];

            text.Text = label9.Text;
            TextObject textn = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["nombre"];

            textn.Text = nombre;
            TextObject textd = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["direccion"];

            textd.Text = direccion;
            TextObject textc = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["codigo"];

            textc.Text = codigo;
            TextObject textv = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["vendedor"];

            textv.Text = vendedor;
            TextObject textt = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["terminos"];

            textt.Text = terminos;
            TextObject texttotal = (TextObject)cr.ReportDefinition.Sections["Section4"].ReportObjects["total"];

            texttotal.Text = totalF;
            TextObject     texttotaletra = (TextObject)cr.ReportDefinition.Sections["Section5"].ReportObjects["letters"];
            numberToString nt            = new numberToString();
            string         temp          = totalF;

            temp = temp.Replace("Q.", "");
            texttotaletra.Text = nt.enletras(temp) + " Q.";
            frm.crystalReportViewer1.ReportSource = cr;
            frm.ShowDialog();
        }