>* 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.
>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,
Thanks. I'll check it out.Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer