Crystal report asks for parameter at runtime

25 pts.
Tags:
.NET
C#
Crystal Report
Crystal Reports
Crystal Reports Conditional Parameters
SQL Server 2005
Hello All, I have a problem with crystal reports at runtime...... I have a desktop application in which I have used crystal report... When I run the application, crystal report asks for parameter even though I have supplied it through code in C#. Not able to figure out why this happens..... My Report also contains a subreport which also requires parameter that is required by main report. I think parameter prompt is for subreport Is there any way to remove that prompt? Any kind of help would be appreciated... Thanks a lot Rahul

Software/Hardware used:
crystal Report, Visual Studio 2005

Answer Wiki

Thanks. We'll let you know when a new response is added.

Rahul,

If a Crystal Report asks for parameters that means you don’t supply them.

You said that your subreport has parameters as well. Do you supply these parameters from VS? Another way of doing that is to link main report parameters to the subreport parameters.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Rahuldjain
    I do not supply parameter to the subreport from VS. I've supplied parameter for main report only from VS. Subreport is in main report and linked from there only. I tried to use "Change Subreport Links" on the subreport from the main report and linked one field of main report to link with the subreport but that does not work. Also tried to Re-import subreport but that also would not work.
    25 pointsBadges:
    report
  • DotNETDeveloper
    Yes you can do this. I suggest the following: In your subreport make the report parameter a multi-value parameter. Test the subreport stand alone and make sure it works. Then drop the subreport into your main report, and map the subreport parameters to the main report parameters. Scenario 1 (multi value parameter pass through): The Main report has report parameter A which is a multi value parameter. You want to pass it to SubReport1 which has a report parameter B which is also defined as multi value parameter. In this case the mapping is just a simple parameter expression: =Parameters!A.Value The subreport RDL element would look like this: <Subreport Name="SubReport1"> ... <Parameters> <Parameter Name="B"> <Value>=Parameters!A.Value</Value> </Parameter> </Parameters> </Subreport> Scenario 2: The Main report has no report parameters. You have a SubReport1 with a report parameter B defined as multi value parameter. You want to pass e.g. three selected values "A", "B", "C" as parameter values to the subreport. You need to create a multidimensional object array on-the-fly, e.g. with the Split function, e.g.: =Split("A,B,C", ",") RDL example: <Subreport Name="SubReport1"> ... <Parameters> <Parameter Name="B"> <Value>=Split("A,B,C", ",")</Value> </Parameter> </Parameters> </Subreport> Scenario 3: The Main report has a multi-value parameter A. You want to pass only the first selected value from the main report's parameter to the subreport and the subreport's report parameter B is a single-value parameter. You can do this by using e.g. =Parameters!A.Value(0) RDL example: <Subreport Name="SubReport1"> ... <Parameters> <Parameter Name="B"> <Value>=Parameters!A.Value(0)</Value> </Parameter> </Parameters> </Subreport>
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following