Search code examples
crystal-reports

Crystal report , passing multi value parameters


Good Day ,

I am using Crystal report 2013 and have an interesting scenario , Let's say I have created a report which accepts one parameter and shows a list of records in a table based on that parameter.

Now I want to be able to send comma seprated values in the same parameter and want my report to run multiple times (equal to number of values in parameter) and show me as many tables as are the values sent to the report.

so let's say the parameter name is userIds , I want to pass this parameter like userIds=a,b,c and want my report to show me 3 tables having the information about that user.

In a web applicaiton we achieve this by having a component (JSP page which creates the HTML table for us) and call the componenet in a loop to get table for each user id and embed it to create one page showing all these tables.

Can we do the similar login in Crystal report and how?


Solution

  • I used another approach to resolve this case , below are the sreps

    1) I introducted a query in my main report which returns distinct user id (to be used for grouping the data in report). 2) I added multiple sub reports in the details section , I made sure all the commands in those subreport should also return user id. 3) I inserted a group group and seleted user id to be used as group. 5) Now when I run the report , the main query returns me the distinct user ids , the details section prints the information grouped by the user id.

    I hope I have answered in a clean way , in case if you have any suggesstions please let me know.

    Note : I found that the initial solution was based on component based approch we use in programing laguages but Crystal report is a tool and I had to get myself fimiliar with a different mind set.