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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP and Crystal Parameters

Status
Not open for further replies.

erp84

IS-IT--Management
Mar 11, 2013
35
US
Ok, so I went and picked up a copy of CrysDev and put together a VFP form with the Crystal viewer on it. I have it all working great, now I would like to expand and have one of my parameters filled in (instead of prompting).

I read through this book a dozen times and I'm totally confused on how to achieve this, and I can't seem to find any examples of this.
 
Yes, this is possible. It's difficult to give you any concrete advice without knowing exactly what you are trying to achieve, and what you have done so far. But in general ....

I'll assume you know how to create a report object (usually called loRep in VFP). That object has a collection of parameter fields, which you can access programmatically. Let's say you want to access a parameter named {?Category}. You could do it something like this:

Code:
FOR EACH loParam IN loRep.ParameterFields
  IF loParam.Name = "{?Category}"
     loParam.ClearCurrentValueAndRange
     loParam.AddCurrentValue("A1") 
     loParam.AddCurrentValue("A2")
     loParam.AddCurrentValue("A3")
ENDIF

This asumes that the parameter accepts multiple values, and A1, etc are the values that you want to assign.

If the parameter accepts a range of numeric values, you would do this

Code:
FOR EACH loParam IN loRep.ParameterFields
  IF loParam.Name = "{?Category}"
     loParam.ClearCurrentValueAndRange
     loParam.AddAddCurrentRange(0, 100, 3)
ENDIF

The "3" means that the range is inclusive.

The above is just meant to give you the general idea. If it doesn't answer your question, you will need to give more details of exactly what you are trying to do. You'll be pleased to know that Craig Bernston, the author of CrysDev, is a regular in this forum, and is always happy to answer questions here.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Erp84,

Do you still have this problem? Were my suggestions any help to you? If not, give us some more information and I'll try to help. If it did help, it would be nice if you could let us know - if only for the benefit of anyone else who might have the same issue.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Sorry for the delay, I just had a chance to test it out earlier today and I got it working perfect! Thanks a bunch for your help! Hopefully as I develop my skills I'll be able to contribute here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top