I am planning on creating a bar graph where grouping is selected at runtime by the user. For example, suppose I have the following table in a database:
In the reporting services Dataset, I could have a query like:
The result would be displayed in a graph with a bar for each Area. But in my application, I want to allow the user to group by different fields such as Code. So my query could change to:
My question is... is there a way to allow Reporting Services to do this type of alteration on the fly with parameters? I know how to use parameters for filtering the WHERE condition, but this would require parameters for grouping. Not only the GROUP BY, but also the SELECT list. Is it possible with parameters, or do I need to change the Dataset query myself through code?
If I do need to alter the underlying Dataset through code, does that mess up the Report Definition stored in the RS database? Are there problems if a concurrent user is running the same report?
Any ideas are appreciated. Thanks!
Code:
Defect Table
ID Area Code DefectCount
1 A Red 12
2 A Yellow 1
3 B Red 15
4 B Yellow 4
5 C Red 13
6 C Yellow 7
7 D Red 10
8 D Yellow 3
Code:
SELECT Area, SUM(DefectCount)
FROM Defect
GROUP BY Area
Result:
A 13
B 19
C 20
D 13
Code:
SELECT Code, SUM(DefectCount)
FROM Defect
GROUP BY Code
Result:
Red 50
Yellow 15
If I do need to alter the underlying Dataset through code, does that mess up the Report Definition stored in the RS database? Are there problems if a concurrent user is running the same report?
Any ideas are appreciated. Thanks!