Pregunta de Data REport
Publicado por Gilberto (225 intervenciones) el 20/07/2005 02:56:05
Hola amigos..
He realizado reportes con el componente de data report, pero ahora me estoy volviendo loco con un encabezado de grupo que necesito.. no se como hacerlo funcionar... aunque se como agregarlo al formulario de informe...... no se como hacer para que los campos de encabezado me salgan en el encabezado de grupo y el resto de campos subordinados me salgan en la seccion de detalle..
Alguien me puede ayudar.. ???? De verdad gracias..
groval.
Este es el codigo que utilizo para los reportes..
Public Sub ReportePRESUPUESTO()
Set rstREPOPRESUPUESTO = New ADODB.Recordset
rstREPOPRESUPUESTO.CursorLocation = adUseClient
rstREPOPRESUPUESTO.Open strQueryPRESUPUESTO, cnn2, adOpenDynamic, adLockPessimistic
X = rstREPOPRESUPUESTO.RecordCount
With DRPresupuesto.Sections("Section1").Controls 'section1 mean that section you create in datareport
.Item("texto1").DataField = rstREPOPRESUPUESTO("municipio").Name
.Item("texto2").DataField = rstREPOPRESUPUESTO("Lugar").Name
.Item("texto4").DataField = rstREPOPRESUPUESTO("fechaAdicion").Name
.Item("texto5").DataField = rstREPOPRESUPUESTO("presupuestoAnual").Name
.Item("texto7").DataField = rstREPOPRESUPUESTO("REgalias").Name
' .Item("texto8").DataField = rstREPOPRESUPUESTO("ActividadEconomica").Name
.Item("texto6").DataField = rstREPOPRESUPUESTO("observaciones").Name
End With
With DRPresupuesto.Sections("Section2").Controls
.Item("etiqueta1").Caption = "Municipio"
.Item("etiqueta3").Caption = "Lugar"
.Item("etiqueta11").Caption = "Fecha Adicion"
.Item("etiqueta6").Caption = "Presupuesto"
.Item("etiqueta5").Caption = "Regalias"
End With
With DRPresupuesto.Sections("Section4").Controls
.Item("etiqueta9").Caption = strTituloInformePRESUPUESTO
End With
With DRPresupuesto.Sections("Section5").Controls
.Item("etiqueta13").Caption = "TOTAL REGISTROS IMPRESOS " & " " & X
.Item("Function1").DataField = rstREPOPRESUPUESTO("presupuestoAnual").Name
.Item("Function2").DataField = rstREPOPRESUPUESTO("Regalias").Name
End With
DRPresupuesto.Caption = strTituloInformePRESUPUESTO
Set DRPresupuesto.DataSource = rstREPOPRESUPUESTO
DRPresupuesto.Show
End Sub
He realizado reportes con el componente de data report, pero ahora me estoy volviendo loco con un encabezado de grupo que necesito.. no se como hacerlo funcionar... aunque se como agregarlo al formulario de informe...... no se como hacer para que los campos de encabezado me salgan en el encabezado de grupo y el resto de campos subordinados me salgan en la seccion de detalle..
Alguien me puede ayudar.. ???? De verdad gracias..
groval.
Este es el codigo que utilizo para los reportes..
Public Sub ReportePRESUPUESTO()
Set rstREPOPRESUPUESTO = New ADODB.Recordset
rstREPOPRESUPUESTO.CursorLocation = adUseClient
rstREPOPRESUPUESTO.Open strQueryPRESUPUESTO, cnn2, adOpenDynamic, adLockPessimistic
X = rstREPOPRESUPUESTO.RecordCount
With DRPresupuesto.Sections("Section1").Controls 'section1 mean that section you create in datareport
.Item("texto1").DataField = rstREPOPRESUPUESTO("municipio").Name
.Item("texto2").DataField = rstREPOPRESUPUESTO("Lugar").Name
.Item("texto4").DataField = rstREPOPRESUPUESTO("fechaAdicion").Name
.Item("texto5").DataField = rstREPOPRESUPUESTO("presupuestoAnual").Name
.Item("texto7").DataField = rstREPOPRESUPUESTO("REgalias").Name
' .Item("texto8").DataField = rstREPOPRESUPUESTO("ActividadEconomica").Name
.Item("texto6").DataField = rstREPOPRESUPUESTO("observaciones").Name
End With
With DRPresupuesto.Sections("Section2").Controls
.Item("etiqueta1").Caption = "Municipio"
.Item("etiqueta3").Caption = "Lugar"
.Item("etiqueta11").Caption = "Fecha Adicion"
.Item("etiqueta6").Caption = "Presupuesto"
.Item("etiqueta5").Caption = "Regalias"
End With
With DRPresupuesto.Sections("Section4").Controls
.Item("etiqueta9").Caption = strTituloInformePRESUPUESTO
End With
With DRPresupuesto.Sections("Section5").Controls
.Item("etiqueta13").Caption = "TOTAL REGISTROS IMPRESOS " & " " & X
.Item("Function1").DataField = rstREPOPRESUPUESTO("presupuestoAnual").Name
.Item("Function2").DataField = rstREPOPRESUPUESTO("Regalias").Name
End With
DRPresupuesto.Caption = strTituloInformePRESUPUESTO
Set DRPresupuesto.DataSource = rstREPOPRESUPUESTO
DRPresupuesto.Show
End Sub
Valora esta pregunta


0