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

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void contruyeCotizacionProveedor()
        {
            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();
            CrystalReport10  cr  = new CrystalReport10();

            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();
        }