Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Report: Prompt for parameter

Posted on 2011-02-19
14
Medium Priority
?
1,972 Views
Last Modified: 2012-05-11
Hi,

I made a crystal report inside VS 2005. The report has a sub-report. Now when i run a report from my .net application, there is a prompt for a parameter. The parameter that is being prompted is from sub-report. Although there are 3 parameters in main report and 1 in sub report, the one in sub report is what is being prompoted for an input.

When i supply a value to that parameter, then the report is being running succesfully.

I have done the following to avoid this;

1. Verify the database (from crystal report)

2. Set Database source location (from CR)

Attached snapshot makes clear my question in detail.

Inputs appreciated.

Thanks!!
crystal-report-parameter-prompt.png
0
Comment
Question by:meispisces
[X]
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
  • 7
  • 3
  • 2
  • +2
14 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34932594
You need to check the settings for the parameter in the subreport (compare with how you have them set for the main report).

OR
supply the required parameter when you are opening the report in the viewer
0
 
LVL 12

Expert Comment

by:JayConverse
ID: 34932701
Right click on the subreport, change the subreport links, and make sure that you connect a field or another parameter from the main report to the subreport's parameter.
0
 
LVL 7

Author Comment

by:meispisces
ID: 34933116
@AndyAinscow: I have supplied the parameter when opening the report viewer by code. Not sure how to check the settings for the parameter in subreport.

@JayConverse:  I have not applied links to connect the parameter as such. Just guide me on that front, please...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 12

Accepted Solution

by:
JayConverse earned 2000 total points
ID: 34933138
Edit the report in Crystal
Right click on the subreport
Select Change Subreport Links
Connect something from Available Fields to the parameter in your subreport
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34933287
>>I have supplied the parameter when opening the report viewer by code.

Are you certain?  If you have it should not be prompting for it.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 34933477
Crystal will automatically prompt for parameters even if you give them values unless you turn prompting off.  There is a property for the report that if set TRUE will always prompt when a report is open.

I believe it is in REPORT OPTIONS.  You apparently have the main report set to false but the subreport set true.

mlmcc
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34933753
I have had another idea.
Please post the complete code for setting the parameters in the main and sub report (including all intermediate code concerning the report)
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34937659
Wierd - as far as I understand your question doing what was suggested would not cure it.  You should still be being prompted for the parameter.  
One does not need to use or display the parameter in the report.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 34937855
Crystal will only prompt for the parameters it needs so if you add a parameter to the report but don't use it in the report there will be no prompt.

For subreports, if you pass it a valid value, then you won't get prompted for a value either.

mlmcc
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34938505
@mlmcc
That seems to say you agree with my previous comment that the comment accepted as a solution does actually adress the question being asked.  Is that correct?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34938508
CORRECTION:
@mlmcc
That seems to say you agree with my previous comment that the comment accepted as a solution does not actually adress the question being asked.  Is that correct?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 34939369
The commnet does solve it because he suggested linking the subreport to the main report using the parameter field so the link is supplying a value to the subreport parameter.

mlmcc
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34940712
My point being is that prior to the comment accepted the questioner did state (in response to my first comment) that the parameter in the sub report was already being set from code - and it was still prompted for.
I can understand what you mean but it does sound like the response to my comment was not actually correct.
0
 

Expert Comment

by:Roy_Hasselman
ID: 37625864
The problem described started occurring for me in an ASP.Net application when I upgraded to Crystal Reports for .NET Framework 4.0 (I was previously using the Crystal 9 runtime).  After a fair amount of searching and experimentation, I seem to have happened upon a solution that works (so far) for me, which is to call the ApplyCurrentValues method on the parameter field after adding the value(s).  I now do this even if UseCount = 0 and so far, so good.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

715 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