Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/11/2009, 10:55
Avatar de lokoman
lokoman
 
Fecha de Ingreso: septiembre-2009
Mensajes: 502
Antigüedad: 14 años, 7 meses
Puntos: 47
Respuesta: Data report - varios registros

Hola!!
La forma en que utilizo el datareport, es creando un recordset y pasando sus campos a los campos en la seccion de detalles del reporte (RptTextBox), de esa forma me salen todos los registros.

strSelect = "SELECT [CAMPO1],[CAMPO2] FROM [TABLA]"

rsData.Source = strSelect
rsData.Open , Conexion, adOpenForwardOnly, adLockReadOnly

If Not rsData.EOF Then

With drREporte
Set .DataSource = Nothing
.DataMember = ""
Set .DataSource = rsData.DataSource

With .Sections("Section1").Controls
For I = 1 To .Count
If TypeOf .Item(I) Is RptTextBox Then
.Item(I).DataMember = ""
.Item(I).DataField = rsData.Fields(I - 1).Name
End If
Next I
End With

.Caption = "Titulo del Reporte"
.Show (vbModal)
End With

End If 'rsData.EOF