Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Report Viewer table locations
Message
From
07/10/2005 12:48:23
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
 
 
To
07/10/2005 11:38:41
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01056983
Message ID:
01057257
Views:
10
I think I've got it! Here's the code for anyone else who might need it (I'm using CR10, VFP8 and Fox2X tables):
loCR=CREATEOBJECT("CrystalRuntime.Application")
loRpt=loCR.OpenReport("MyReport.rpt")

IF loRpt.HasSavedData
   loRpt.DiscardSavedData()
ENDIF
FOR EACH loTable IN loRpt.Database.Tables
   loTable.Location=FORCEPATH(loTable.Location,"c:\MyPath\")+".dbf"
ENDFOR
FOR EACH loSection IN loRpt.Sections
   FOR EACH loObject IN loSection.ReportObjects
      IF loObject.Kind=5 && Subreport
         loSub=loRpt.OpenSubreport(loObject.SubReportName)
         IF loSub.HasSavedData
            loSub.DiscardSavedData()
         ENDIF
         FOR EACH loTable IN loSub.Database.Tables
            loTable.Location=FORCEPATH(loTable.Location,"c:\MyPath\")+".dbf"
         ENDFOR
      ENDIF
   ENDFOR
ENDFOR
>That's what I'm trying to do, but I can't seem to find the collection of subreports. I can open a specific subreport once I have a name, but I can't see how to get them through the collection.
>
>>There is a subreports collection on the main report. Drill down through each one, setting it's properties just as you would with the main report.
>>
>>>This has been helpful, but how do I drill down to the tables of each subreport?
>>>
Elyse Pomerantz
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform