
07/11/2006, 03:15
|
| | Fecha de Ingreso: marzo-2005
Mensajes: 276
Antigüedad: 20 años, 1 mes Puntos: 0 | |
Envío mi código por si con esto alguien me puede ayudar:
Dim Report As New CrystalReport6
(CrystalReport6 es el .dsr, el archivo que he creado utilizando el diseñador de informes)
Private Sub Form_Load()
Report.DiscardSavedData
If opcion <> "nuevo" Then
MsgBox "Recuerde que se visualizará la última versión grabada de esta oferta."
End If
'CRViewer91.RefreshEx True
CRViewer91.EnableRefreshButton = True
Screen.MousePointer = vbHourglass
'Dim ConnectionInfo As CRAXDDRT.ConnectionProperties
Dim CPProperties As CRAXDDRT.ConnectionProperties
Dim dbTable As CRAXDDRT.DatabaseTable
Set dbTable = Report.Database.Tables(1)
Set CPProperties = dbTable.ConnectionProperties
CPProperties.Item("DSN").Value = "DIMO_SQL"
CPProperties.Item("Database").Value = "BBDD
CPProperties.Item("User ID").Value = "USER"
CPProperties.Item("Password").Value = "PWD"
'.......
dbTable.TestConnectivity
'If Form4.Label2.Caption = 1 Then
If Form1.CentroCoste_O.ListIndex <> -1 Then
centrocoste = Form1.CentroCoste_O.ItemData(Form1.CentroCoste_O.L istIndex)
Else
centrocoste = Form1.CentroCoste_O.ItemData(centrocoste_rev)
End If
'Else
'centrocoste = Form1.CentroCoste_O.ItemData(Form1.CentroCoste_O.L istIndex)
'End If
centrocoste = Format(centrocoste, "00")
'MsgBox centrocoste
codoferta = Mid(Form1.estado_O.Text, 1, 2) & "_" & Form1.num_O.Text & centrocoste
'MsgBox codoferta
'Report.SQLQueryString = "SELECT Ofertas.*, clientes.* FROM Ofertas INNER JOIN clientes ON Ofertas.codcliente = clientes.Codigo WHERE Ofertas.codoferta ='OM_000130'"
Report.SQLQueryString = "SELECT clientes.*, Ofertas.*, personal.*, CentrosCoste.* FROM personal INNER JOIN Ofertas ON personal.id = Ofertas.ofertante INNER JOIN clientes ON Ofertas.codcliente = clientes.Codigo INNER JOIN CentrosCoste ON Ofertas.centrocoste = dbo.CentrosCoste.codigo COLLATE SQL_Latin1_General_CP1_CI_AS WHERE Ofertas.codoferta ='" & codoferta & "'"
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
CRViewer91.Zoom 84
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer91.Top = 0
CRViewer91.Left = 0
CRViewer91.Height = ScaleHeight
CRViewer91.Width = ScaleWidth
End Sub
Snif... |