Ver Mensaje Individual
  #5 (permalink)  
Antiguo 19/09/2011, 20:13
zeusandnereus
 
Fecha de Ingreso: mayo-2011
Mensajes: 10
Antigüedad: 13 años
Puntos: 0
Respuesta: dataGrid a CrystalReport Directo

Muchas gracias por la ayuda.. pude resolver mi problema.

pongo como lo resolvi por si alguien se pudiera servir en algun momento.

1° Cree un dataSet(dataset.xsd) ,el cual se llama pagoReport - dentro de este dataSet cree el datatable que son los mismos campos de mi datagrid, en este caso se llama Report

2° Asocie el dataSet creado a mi Informe de crystal report , el cual se llama report1.

3° en el boton de imprimir en donde se encuentra el datagrid Agregue el siguiente codigo:


Código vb:
Ver original
  1. Dim MyDataSet As New pagosReport 'Conjunto de datos
  2.        Dim MyDataTable As New pagosReport.ReportDataTable 'dataTable del conjunto de datos
  3.        Dim mi_rptSocios As New report1 'Documento cristal reports
  4.        'Dim miReporte As New reportP 'Formulario visor
  5.        Dim filas As Integer = dgvReporte.Rows.Count - 1
  6.         Dim i As Integer = 0
  7.         For i = 0 To filas - 1
  8.             'Paso los datos al dataset (los campos del grid)
  9.            MyDataTable.Rows.Add(dgvReporte.Rows(i).Cells("FechaIngreso").Value,
  10.     Me.dgvReporte.Rows(i).Cells("CodigoCaso").Value,
  11.     Me.dgvReporte.Rows(i).Cells("RutCliente").Value,
  12.     Me.dgvReporte.Rows(i).Cells("NombreCliente").Value,
  13.     Me.dgvReporte.Rows(i).Cells("Honorarios").Value,
  14.     Me.dgvReporte.Rows(i).Cells("Pagos").Value,
  15.     Me.dgvReporte.Rows(i).Cells("Boleta").Value,
  16.     Me.dgvReporte.Rows(i).Cells("Estado").Value,
  17.     Me.dgvReporte.Rows(i).Cells("Sucursal").Value)
  18.             Me.ProgressBar.Value = i
  19.  
  20.         Next (i)
  21.         MyDataSet.Tables("Report").Merge(MyDataTable)
  22.         mi_rptSocios.SetDataSource(MyDataSet)
  23.         reportP.CrystalReportViewer1.ReportSource = mi_rptSocios
  24.         reportP.Text = "Reporte"
  25.         reportP.Show()

y con eso ya deberia funcionarles.


Muchas gracias al amigo Aquaventus el cual me oriento con sus link's

Si alguien necesita o tiene alguna pregunta no duden en escribirme.