cancel
Showing results for 
Search instead for 
Did you mean: 

Passing discrete(Single) and array of values to Crystal Report via ASP.NET

Former Member
0 Kudos

Hi ,

i am working with VS 2005(ASP.NET) and Crystal report XI R2.

My crystal report has 5 parameters.All 4 parameters takes single value(Discrete) at a time and one will take multiple values .

I have to pass the values for these parameters via asp.net.

I am able to pass the values to all the 4 discrete parameters.

I would like to know how to pass an array as parameter to the Crystal report for my 5th Parameter.

Please let me know if you require more information.

Thanks and Regards,

Smitha.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Couple of paces to look:

1) Download the samples from here:

https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe

https://smpdl.sap-ag.de/~sapidp/012002523100006252722008E/csharp_win_smpl.exe

Look at the sample vbnet_winmultirangeparam.zip (or it's equivalent C#).

2) This article is a great source of tons of sample code snippets:

http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

Also, search this forum. There are a number of great posts on parameters.

Ludek

Former Member
0 Kudos

Hi Ludek,

Thanks for your response.

I just went through the samples provided by you.It was of great help.Thanks once again.

I would like to get clarification on some more queries regarding passing the parameters

I have a Main report which has 5 sub reports in it.

The main report just act as a place holder for the sub reports.it doesnu2019t have any tables or fields.

The Main report just has one parameter(Parameter Name :-ShowReports) which takes multiple values.

This parameter is used in the Main report to decided which all sub report to display according to the users selection in the UI.

Regarding the Sub reports:-

a) 3 Sub reports has one parameter each with same value(Parameter Name :- Handle)

b) 2 Sub reports has 3 parameter each with same value(Parameters are :- id1,id2,id3)

So in total even though I have 10 Parameter, I need to pass values only to 5 Parameters.

Ie for ShowReports u2013 Used in Main report(Multiple Values)

Handle - Used in 3 Sub Reports(Discrete Value)

id1,id2,id3 - Used in 2 Sub Reports(Discrete Values)

As I was going through the code I noticed that, to pass the value to a parameter in subreport I need to mention the name of the Subreport.

But in my case I cant do so, because the same parameters are used across different sub reports.

When I run the crystal report manually it ask only for 5 parametrs and it is working fine.

But when I try to do with asp.net it is giving an error saying that u201CMissing parameter valuesu201D

When I saw the report Properties I could see that the parameter count is 10.

Could please help me on this ?

Please let me know if you require more detail information on this issue.

Regards,

Smitha.

former_member200290
Contributor
0 Kudos

Hi Smitha,

If you have linked parameters (paramters that are linked from main to sub) you do not need to set them. If you are only being prompted for 5 and at runtime the SDK is reporting you have 10, then I would guess you have linked parameters. The only way that I can think of finding out if a parameters is linked is to check its name to see if it starts with Pm. If it starts with Pm you should not need to set it.

Any parameter that does not have this in its name you will need to set.

Trevor

Former Member
0 Kudos

Hi Trevor,

Thanks for your response. It worked for me and was able to do with using 5 parameters in ASP.NET.As you said all parameters are linked parameters .

Regards,

smitha

Answers (0)