Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change data table location during program executi
Message
From
15/03/2004 04:38:17
 
 
To
03/03/2004 02:19:33
Eugene Kolmakov
Millennium Technologies
Vladivostok, Russia
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Miscellaneous
Thread ID:
00882608
Message ID:
00886221
Views:
24
Hi...

It works a little strange.
From some tests I've done saw that you can't change the name of the datasource tables... So what I'm doing is to add something to the end of each filename.

Say you have a report with 2 tables... my_header, my_detail which are linked with an index on a common field.. eg id. In the datasource location you should have these 2 tables (my_header and my_detail)

************************************************************
cpath="c:\reports\" && a path where you put your tables

rep_add=substr(sys(2015),3)
rep_ext=".dbf"+rep_add
rep_cdx=".cdx"+rep_add

rep_header="my_header"+rep_ext
rep_detail="my_detail"+rep_ext

select my_header && i believe you are doing something like that
copy to (cpath+rep_header) type foxplus as 737 with cdx

select my_detail
copy to (cpath+rep_detail) type foxplus as 737 with cdx

* rename for cdx (IF you have indexes)
rename (cpath+"my_header.cdx") to (cpath+rep_header+rep_add)
rename (cpath+"my_detail.cdx") to (cpath+rep_detail+rep_add)

CRXReport = goCrystl.OpenReport("XXX.rpt") && the name of the report
for each rep in CRXReport.Database.Tables
rep.location=cpath+rep.location+rep_ext
endfor
CRXReport.Database.verify()
**************************************************************

I hope I have helped....
Previous
Reply
Map
View

Click here to load this message in the networking platform