Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick Crystal question - Passing Range Int Values from VFP8 to CR 9.0 2

Status
Not open for further replies.

tncf

IS-IT--Management
Aug 27, 2005
7
PR
Hello. I can't seem to figure out how pass a range of INT values to a Crystal Report (v9.0 ).
I use the crviewer to display the reports.

The idea is to pass a parameters whereby only, let say, records with id (being INT field) = 4, 9 or 15 are selected. The SQL part I can handle.

In the parameter section in Crystal I have selected the 'Allow Range' option.

I guess my problem is that I do now know the syntax that Crystal expects... "4,9,15" "[4,9,15]" ???

Any ideas?
 

From what you say, it looks like you want to pass a list of values rather than a range of values. If you want to pass 4, 9 and 15, that's a list. If you want to pass all values between 4 and 15, that's a range.

Assuming you want to pass a list, here's some code that might help:

Code:
FOR EACH loParam in loRep.ParameterFields
  IF loParam.Name = {?MyParameterName}
    loParam.ClearCurrentRangeAndValues
    loParam.AddCurrentValue(4)
    loParam.AddCurrentValue(9)
    loParam.AddCurrentValue(15)
    ENDIS
ENDFOR

I haven't tested this, but it should point you in the right direction.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Also make sure you setup the parameter to accept multiple values.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Thanks to both of you! That worked well!

CF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top