Ver Mensaje Individual
  #11 (permalink)  
Antiguo 06/02/2010, 13:42
bionet_x86
 
Fecha de Ingreso: febrero-2010
Mensajes: 10
Antigüedad: 14 años, 2 meses
Puntos: 0
Respuesta: Visual Basic 6 - Crystal XI... Novato !!!

Cita:
Iniciado por abrahamvj Ver Mensaje
Que raro... envia el codigom usado

Abraham
Estimado mas arriba esta el codifo...

bueno al final hice esto y genere el reporte en excel bajo una plantilla creada por mi, les dejo el codigo:


Cita:
Public Sub Pase_Excel(ByVal Str_Sql As String, ByVal Path_Archivo As String)

Dim Int_Columnas As Integer
Dim Int_Filas As Integer
Dim excelApp As Excel.Application
Dim excellibro As Excel.Workbook
Dim excelhoja As Excel.Worksheet

Set Consulta = New ADODB.Recordset 'CREANDO OBJETO DE DATOS

With Consulta
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockBatchOptimistic
Set .ActiveConnection = mod_Conexion.Conexion
.Open Str_Sql
End With

Set excelApp = New Excel.Application
Set excellibro = excelApp.Workbooks.Open(App.Path & "\" & Path_Archivo & " ")
Set excelhoja = excellibro.ActiveSheet
Int_Columnas = Consulta.Fields.Count
Int_Columnas = Int_Columnas + 1

'For i = 2 To Int_Columnas
'excelhoja.Cells(6, i) = Consulta.Fields(i - 2).Name
'Next

If Consulta.RecordCount > 0 Then
Consulta.MoveFirst

For Int_Filas = 1 To Consulta.RecordCount

For j = 2 To Int_Columnas

If IsNull(Consulta(j - 2).Value) Then
excelhoja.Cells(Int_Filas + 8, j) = ""
Else
excelhoja.Cells(Int_Filas + 8, j) = CStr(Consulta(j - 2).Value)
End If
Next
Consulta.MoveNext
Next
End If


Set Consulta = Nothing
excelApp.Visible = True

End Sub