Hi All,
Here's a snippet of code I'm using to run a crystal report using two linked tables.
I've had much success doing this with one table but never tried two until now.
I usually create a form property ".otable" and the use this code, which works with one table.
.otable = .otables.item(1)
.otable.location = "F:FOXDAT\yr_ped.DBF"
For two tables I tried adding a second form property ".otable_yr_name ", with this code added:
.otable_yr_name = .otables.item(1)
.otable.location = "F:\FOXDAT\yr_name.DBF"
Am I missing something here, it works occaisionally??????
with thisform
.r_crystalapp = createobject("crystalruntime.application")
.r_crreport = .r_crystalapp.openreport(lc_crreport)
.odatabase = .r_crreport.database
.otables = .odatabase.tables
.otable = .otables.item(1)
.otable.location = "F:FOXDAT\yr_ped.DBF"
.otable_yr_name = .otables.item(1)
.otable.location = "F:\FOXDAT\yr_name.DBF"
.r_crreportoptions = .r_crreport.exportoptions
with .r_crreportoptions
.formattype = (14)
.destinationtype = (1)
.diskfilename = (lc_word)
endwith
.r_crreport.export(.f.)
.otable = " "
.otable_yr_name = " "
.otables = " "
.odatabase = " "
.r_crreport = " "
.r_crystalapp = " "
endwith