Crystal Reports 8.5 Passing Parameters dynamically??

Posted on 2004-10-19
Last Modified: 2012-06-22
I have a set of asp pages that are a plug-in for our custom application.

The basic function of these pages is to open a report, which the user selects during runtime and display it using the activeX control.

I need to add the following functionality.
I need to determine if the report has any parameters on it, and if so prompt the user for input to the parameter.  I am having trouble trying to figure out how to do this.  From what ive seen you need to specify the name of the parameter to be able to access it as an object.

Session("oRpt").ParameterFields.GetItemByName("ExampleStringParameter").AddCurrentValue(CStr("I am a string"))

How can i find out the parameter name and prompt the user for the value just by executing my asp pages?

Greg R
Question by:Rowdyone52
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Accepted Solution

stasau earned 500 total points
ID: 12351771
You can do this by looping through the parameter fields add creating you page based on that.  I did it once but it was a pain.  Do something like (I dont remember the code exactly since I have not worked with 8.5 in a long time):

'Loop through all of the parameters in the Report
for i = 0 to Session("oRpt").ParameterFields.Count
  'Build you control here - something like
  Response.write "<input type=text name='" & Session("oRpt").ParameterFields(i).ParameterFieldName & "' >

Using the Paramterfields collection you can also get the Prompt, default values, ranges and other things and make this a lot better.  If I have time tonight I will throw together an example if you need more help.


Author Comment

ID: 12351788
is there a way to use the EnableParameterPrompting to prompt the users for the parameters?  I can do this when it refreshes, but only on refresh

Expert Comment

ID: 12351841
Not that I know of.  Even using my method would force you to create a parameter page and a viewer page (or do a refresh).
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

ID: 12351858
do you know if I looped through all parameters using something like

for i = 0 to Session("oRpt").ParameterFields.Count


and cleared them using


would it force a new prompt?

just throwing out ideas thanks for your help

Expert Comment

ID: 12351885
It might.  In theory it should prompt for anything that does not have a value but I do not remember well enough how prompting works over the web for this version.  I am looking for my code I wrote that does this but I dont know where they moved it too on our network because we replaced it with a newer version.

Author Comment

ID: 12351895
i would love a newer version!! .NET would be nice.

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question