Information générale
Catégorie:
Crystal Reports
Titre:
Cannot change table location for subreport in Crystal
Hello, All
I'm using VFP 7.0 and Crystal Reports Version 8.5 and 9.0. I have to modify our software to run in a terminal server environment where each user will have there own directory to save temp files for the crystal reports to run. I'm currently using ODBC and don't know if it is even possible to change the file locations programmatically since it uses the file DSN. I can convert the reports to use FOX2X type, but I'm still having problems with the reports that have subreports. I can successfully change the table location for the main report, but I'm having trouble getting the subreport table location to work. I'll provide code below with the subreport name hardcoded. The problem is that it ignores my variable that has the local path where the table is located. I'm willing to use another method to connect to data if it would be better. Thanks in advance for you help.
******************************************************
PUBLIC CRApplication AS CrystalRuntime.APPLICATION
LOCAL CRReport AS CrystalRuntime.REPORT
LOCAL crviewer AS crviewer.crviewer
LOCAL oDBT AS CRAXDRT.DatabaseTable
LOCAL oDB2 AS CRAXDRT.DatabaseTable
LOCAL subreport AS CRAXDRT.SubreportObject
CRApplication = CREATEOBJECT("CrystalRuntime.Application")
CRReport = CRApplication.OpenReport(rptname)
THIS.ADDOBJECT("CRViewer","olecontrol","CRViewer.CRViewer") && Crystal 8.5
oDBT = CRReport.DATABASE.TABLES.ITEM(1)
oDBT.Location = m.localpath + "timecrd.dbf"
subreport = CRReport.OpenSubreport("TimeCardSub.rpt")
oDB2 = subreport.DATABASE.TABLES.ITEM(1)
oDB2.Location = m.localpath + "timecrdsum.dbf"
*******************************************************
When I trace through the code, oDB2.location = "timecrdsum.dbf" instead of c:\temp1\"timecrdsum.dbf" since m.localpath = "c:\temp1\"
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement