Solved

Crystal Reports 8.5 Passing Parameters dynamically??

Posted on 2004-10-19
7
887 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

10 Experts available now in Live!

Get 1:1 Help Now