示例#1
0
        private void btn_Print(object sender, EventArgs e)
        {
            if (dgvDatos.Rows.Count <= 0)
            {
                return;
            }

            string path = string.Empty;

            if (rb4.Checked)
            {
                path = @"\\192.168.2.100\HalcoNET\Crystal\rpt_marbete_4.rpt";
            }
            if (rb10.Checked)
            {
                path = @"\\192.168.2.100\HalcoNET\Crystal\rpt_marbete_10.rpt";
            }

            string itms = string.Empty;

            foreach (UltraGridRow item in dgvDatos.Rows)
            {
                itms += "'" + item.Cells["ItemCode"].Value + "',";
            }

            Constantes.Clases.LoadRPT rpt  = new Constantes.Clases.LoadRPT(path);
            Constantes.frmVisor       form = new Constantes.frmVisor(rpt.DocRPT);
            rpt.SetParameter(itms.Trim(','));
            form.MdiParent = this.MdiParent;
            form.Show();
        }
示例#2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            //string dsXML = (dgvDatos.DataSource as DataSet).GetXml();
            DataSet ds = (dgvDatos.DataSource as DataSet);

            //using (System.IO.StreamWriter fs = new System.IO.StreamWriter("c:\\pp\\datos.xml")) // XML File Path
            //{
            //    (dgvDatos.DataSource as DataSet).WriteXml(fs);


            //}

            Constantes.frmVisor form = new Constantes.frmVisor(ds, @"\\192.168.2.100\HalcoNET\Crystal\rptInformeAuditoriaStocks.rpt");
            form.MdiParent = this.MdiParent;
            form.Show();
        }
示例#3
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                if (!typeDocument.Equals("OC"))
                {
                    this.SetMensaje("Imposible crear versión impresa.", 5000, Color.Red, Color.White);
                    return;
                }

                Constantes.Clases.LoadRPT rpt  = new Constantes.Clases.LoadRPT(IdDocument);
                Constantes.frmVisor       form = new Constantes.frmVisor(rpt.DocRPT);
                rpt.GenerarPDF(DocumentSAP.DocEntry.ToString());
                form.MdiParent = this.MdiParent;
                form.Show();
            }
            catch (Exception ex)
            {
                this.SetMensaje(ex.Message, 5000, Color.Red, Color.White);
            }
            // System.Diagnostics.Process.Start(rpt.GenerarPDF(Document.DocEntry.ToString()));
        }