示例#1
0
 private void button8_Click(object sender, EventArgs e)
 {
     if (textBox6.Text != "" && textBox3.Text != "" && textBox2.Text != "")
     {
         if (textBox4.Text == "")
         {
             textBox4.Text = "   ";
         }
         frm_reporteAbono frm  = new frm_reporteAbono();
         CrystalReport1   cr   = new CrystalReport1();
         TextObject       text = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["numerotxt"];
         text.Text = label9.Text;
         TextObject fecha = (TextObject)cr.ReportDefinition.Sections["Section2"].ReportObjects["fecha"];
         fecha.Text = textBox2.Text;
         TextObject observacion = (TextObject)cr.ReportDefinition.Sections["Section2"].ReportObjects["observaciones"];
         observacion.Text = textBox4.Text;
         TextObject descripcion = (TextObject)cr.ReportDefinition.Sections["Section3"].ReportObjects["descripcion"];
         descripcion.Text = textBox3.Text;
         TextObject monto = (TextObject)cr.ReportDefinition.Sections["Section3"].ReportObjects["monto"];
         monto.Text = textBox6.Text;
         frm.crystalReportViewer1.ReportSource = cr;
         frm.Show();
     }
     else
     {
         MessageBox.Show("DEBE DE LLENAR TODOS LOS CAMPOS", "ABONO CLIENTE", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
 private void contruyeImpresion()
 {
     if (numero != "" && fecha != "" && monto != "")
     {
         frm_reporteAbono frm  = new frm_reporteAbono();
         CrystalReport1   cr   = new CrystalReport1();
         TextObject       text = (TextObject)cr.ReportDefinition.Sections["Section1"].ReportObjects["numerotxt"];
         text.Text = numero;
         TextObject fechas = (TextObject)cr.ReportDefinition.Sections["Section2"].ReportObjects["fecha"];
         fechas.Text = fecha;
         TextObject observacion = (TextObject)cr.ReportDefinition.Sections["Section2"].ReportObjects["observaciones"];
         observacion.Text = textBox1.Text;
         TextObject descripcion = (TextObject)cr.ReportDefinition.Sections["Section3"].ReportObjects["descripcion"];
         descripcion.Text = "PAGO RECIBIDO DEL CLIENTE";
         TextObject montos = (TextObject)cr.ReportDefinition.Sections["Section3"].ReportObjects["monto"];
         montos.Text = monto;
         frm.crystalReportViewer1.ReportSource = cr;
         if (frm.ShowDialog() == DialogResult.OK)
         {
             button5.PerformClick();
         }
     }
     else
     {
         MessageBox.Show("DEBE DE LLENAR TODOS LOS CAMPOS", "ABONO CLIENTE", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }