FoxPro/Visual FoxPro - Crystal report XI

 
Vista:

Crystal report XI

Publicado por Ivonne (35 intervenciones) el 28/03/2007 20:33:18
Hola amigos de la web, alguien me podria decir como puedo conectar reportes realizados en Crystal reports XI con visual fox pro 9...por fa ..les agradeceré mucho la ayuda ya que no encuentro la manera de hacerlo y me es urgente!!..saludos.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

RE:Crystal report XI

Publicado por Ernesto Hernandez (4623 intervenciones) el 28/03/2007 21:14:25
Espero te sirva

Local loCrystalApplication, loCrystalReport, loCrystalReportPara
Local loExport
Local lnTableCount

*!* create a crystal report instance.
loCrystalApplication = createObject('crystalRunTime.Application')

*!* open the report you need.
loCrystalReport = loCrystalApplication.openReport("myReport.rpt")

*!* suppress the logon information
*!* change the logon information programmatically
*!* scan all the tables/view in the report.
lnTableCount = loCrystalReport.Database.Tables.Count
for lni = 1 to lnTableCount
With loCrystalReport.Database.Tables(lni)

*!* Save the current location name for later use.
lcTableName = .Location

*!* Change the table's logon info to correct one.
*!* first is the ODBC data source name.
*!* second is the databas name
*!* third is the login id.
*!* fourth is the password
.SetLogonInfo("myODBC", "myDatabase", "myID", "myPassword)
*!* Change the table's location to follow format
*!* If you just change the table's logon info,
*!* it still using the old database
*!* full name (database.owner.table)
.Location = "myDatabase.dbo.myTable"

EndWith

Next lni

*!* if the report contains parameter, issue the follow codes.
loCrystalReportPara = loCrystalReport.ParameterFields()

*!* first parameter
loCrystalReportPara.item(1).setCurrentValue(paraValue)
*!* second parameter ....n
loCrystalReportPara.item(2).setCurrentValue(paraValue)

*!* print the report to printer with print dialog box.
loCrystalReport.PrintOut(.t.)

*!* to export the report to pdf format
*!* use the below code.

loExport = loCrystalReport.ExportOptions()

With loExport
&& crEFTPortableDocFormat = 31
.FormatType = 31
.DestinationType = 1 && Disk
.DiskFileName = "c:\temp\myReport.pdf" &&result report in disk
EndWith

*!* suppress the export dialog box.
loCrystalReport.export(.f.)



Suerte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Crystal report XI

Publicado por Ivonne (35 intervenciones) el 28/03/2007 22:01:24
Hola de nuevo,este codigo que me estas dando en el Init del formulario en el que lo quiero mandar a llamar lo pongo? o en donde?
Saludos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:Crystal report XI

Publicado por Ernesto Hernandez (4623 intervenciones) el 29/03/2007 17:51:35
Lo puedes usar en el INIT o mucho mejor en el Load

Suerte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Crystal report XI

Publicado por Ivonne (35 intervenciones) el 29/03/2007 19:07:15
Ok,gracias lo voy a checar ahora...saludos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Crystal report XI

Publicado por Ivonne (35 intervenciones) el 29/03/2007 22:40:24
Hola de nuevo,ya probé lo que me dices pero me menciona que loCrystalApplication = createObject('crystalRunTime.Application') no fue encontrado...no habrá otra manera más facil de realizarlo??..Saludos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar