views:

443

answers:

2

I have a stored procedure that takes a user ID and calculates their balance with a really simple query and returns it. I want to add this to a crystal report in my application. The only problem is, Crystal Reports wants me to set a value for the procedure, and setting a single value for it would be useless to me.

I have everything grouped by the User.ID field, and I want to use User.ID as the parameter for the query. How can I do this?

+2  A: 

Within your main report you can add a subreport that will use the stored procedure as a data source and the userId as a parameter.

Your main report will list all the userID you are interested in and pass each of them individually to subreport

It has been quiet some time since I last worked with crystal reports so I do not remember the technical details, only the main concept

kristof
+1  A: 

Couple of options

1. Create a new stored procedure that returns all of the user ID's then create a sub-report for each user linked to the main report of user IDs.

2. If you have the option, change the stored procedure to accept a value like 'All' for the username and have the stored procedure return all values when All is the value. Not 100% sure if this will work, just a brainstorming idea.

Chris Persichetti
I took your second option
Malfist