Solved

Crystal Reports 8.5 Passing Parameters dynamically??

Posted on 2004-10-19
7
894 Views
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?

Thanks
Greg R
0
Comment
Question by:Rowdyone52
  • 3
  • 3
7 Comments
 
LVL 4

Accepted Solution

by:
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 & "' >
next


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.

0
 

Author Comment

by:Rowdyone52
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
0
 
LVL 4

Expert Comment

by:stasau
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).
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

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

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

next

and cleared them using

session("oRpt").ParameterFields.Item(i).ClearCurrentValueAndRange

would it force a new prompt?

just throwing out ideas thanks for your help
0
 
LVL 4

Expert Comment

by:stasau
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.
0
 

Author Comment

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now