0
votes

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?

1
Are you trying to get a different table per parameter? - cojimarmiami
Yes , a different table having teh information about different user.Currently I am exploring the group option but that also is limited in the sense that if I have say more complex cases in my report like for a single user id i want to run multiple queries to fetch more information from different places how will I apply a single group by to all of those. - Sajjad Ahmed Paracha
well you can create as many groups as you want, you can also create a sub-report for each different query. - cojimarmiami
Tha is exactly what I did , I created few subreports for all those tables I wanted in my report (doing that I made sure all the queries in report return the user id which is going to be used in groouping).In the main report I wrote a query to get me distinct user id and use those as grouping values.Now I am able to see the informaiton group by user ids. Thanks - Sajjad Ahmed Paracha

1 Answers

0
votes

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.