VFP Y CRYSTAL REPORT
Publicado por GRYSEL (2 intervenciones) el 04/08/2004 17:47:07
hola, tengo un sistema hecho en vfp con una base se datos Acces y quiero hacer un reporte con crystal report. tengo el siguiente codigo:
cCodMarca=ALLTRIM(Thisform.txtCodMar.Value)
SELECT CodMar,DesMar FROM Marca WHERE CodMar=cCodMarca INTO CURSOR curMarca
SELECT curMarca
** Crea una instancia del RDC de Crystal Reports.
InstRDC= CREATEOBJECT("CrystalRuntime.Application")
**crea una instancia del reporte
InstReporte= CREATEOBJECT("CrystalRuntime.Report")
** Abre el reporte.
InstReporte=InstRDC.OpenReport("G:\BDMC\Reportes\RepMarca.rpt")
** Descarta los datos que se hayan grabado con el reporte.
IF InstReporte.HasSavedData
InstReporte.DiscardSavedData()
ENDIF
** Cambia la ubicación de la tabla donde el reporte toma los datos
**aqui es mi duda *******
InstReporte.Database.Tables(1).Location= CURMARCA
** Realiza la acción deseada por el usuario.
DO CASE
CASE Accion = 1
** Imprimir.
InstReporte.PrintOut(.T.)
CASE Accion = 2
** Vista previa.
DO FORM c:\sistemamc\formas\vistaprevia.scx WITH InstReporte
CASE Accion = 3
** Exportar.
InstReporte.Export(.T.)
ENDCASE
como hago para decirle que la nueva tabla es el cursor de la consulta?
Porfa ayudenme
cCodMarca=ALLTRIM(Thisform.txtCodMar.Value)
SELECT CodMar,DesMar FROM Marca WHERE CodMar=cCodMarca INTO CURSOR curMarca
SELECT curMarca
** Crea una instancia del RDC de Crystal Reports.
InstRDC= CREATEOBJECT("CrystalRuntime.Application")
**crea una instancia del reporte
InstReporte= CREATEOBJECT("CrystalRuntime.Report")
** Abre el reporte.
InstReporte=InstRDC.OpenReport("G:\BDMC\Reportes\RepMarca.rpt")
** Descarta los datos que se hayan grabado con el reporte.
IF InstReporte.HasSavedData
InstReporte.DiscardSavedData()
ENDIF
** Cambia la ubicación de la tabla donde el reporte toma los datos
**aqui es mi duda *******
InstReporte.Database.Tables(1).Location= CURMARCA
** Realiza la acción deseada por el usuario.
DO CASE
CASE Accion = 1
** Imprimir.
InstReporte.PrintOut(.T.)
CASE Accion = 2
** Vista previa.
DO FORM c:\sistemamc\formas\vistaprevia.scx WITH InstReporte
CASE Accion = 3
** Exportar.
InstReporte.Export(.T.)
ENDCASE
como hago para decirle que la nueva tabla es el cursor de la consulta?
Porfa ayudenme
Valora esta pregunta
0