Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxtalk crystal reports
Message
From
12/11/1999 02:22:24
Walter Meester
HoogkarspelNetherlands
 
 
To
12/11/1999 01:47:41
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00290079
Message ID:
00290500
Views:
32
Craig,

>I couldn't define the datafile locations for the subreports at runtime. It just wouldn't work, no matter what I tried. Tech support couldn't get it to work either. I finally decided to always put the data files in the same location everytime and always use the same name.

from my framework:
* aDBFfiles is an ARRAY with two columns:
* column 1: - the file location+name of the table
* column 2: - the name of the subreport (empty for the main report)
* remark: the first rows should specify the tables for the main report.
*         followed by the subreports tables.


oReport=THISFORM.crReport
IF TYPE("THIS.aDBFfiles(1)")="C"
	nI=1
	FOR nT = 1 TO ALEN(THIS.aDbffiles,1)
		IF ALEN(THIS.aDBFfiles,2)>1 AND !EMPTY(THIS.aDBFfiles[nT,2])
			oReport=THISFORM.CrReport.Opensubreport(THIS.aDBFfiles[nT,2])
			nI=1
		ENDIF
		IF !EMPTY(THIS.aDbffiles(nT,1))
			oReport.Database.Tables.item[nI].location = THIS.aDbffiles(nT,1)
		ENDIF
		nI=nI+1
	ENDFOR
ENDIF
Works like a champ.

For passing parameterfields I use the following:

WITH THISFORM.crReport.ParameterFields
FOR nT= 1 TO .Count
cName=.Item(nT).ParameterFieldName
IF TYPE(cName) # "U"
.item(nT).SetCurrentValue(EVAL(cName))
ENDIF
ENDFOR
ENDWITH
<\PRE>
With this code you could simulate using VFP variable within VFP reports. I did not try if this works for subreports too. You might want to try this yourself.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform