Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal Reports 8.5 Passing Parameters dynamically??

Posted on 2004-10-19
7
Medium Priority
?
916 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 2000 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

885 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