I need to create a SSRS summary report which captures a lot of data from many different sources. The report needs to report on about a dozen summary numbers for 3 different types. The computations for each number are pretty complex so I definitely want to optimize the overall reporting.
I’m going to call X/Y/Z “Types” and A/B/C/D/E/D “Items”
Example:
X Y Z
A 10 12 14
B 8 6 11
C 12 0 99
D 10 12 14
E 8 6 11
F 12 0 99
I have the sql to generate each number – a function for each “row” which I just pass X/Y/Z.
My question is how to I gather all the data together to report on it? I can:
-
Create each data point as a subquery and string them together in one long statement with descriptive column names
-
Union all the data for each type together into a single proc/function, so I would get the 1st & 2nd columns in one result set, 1st & 3rd columns together in another, and 1st and 4th columns in a third. Then I suppose I could join these together.
-
Generate each data point as a row (i.e. A;X;10) and pivot them all together.
Also am I best off creating a function for each Item, so I call fnA(X) to get 10? As opposed to just stringing together the SQL in a proc?
I’m reasonably adept at SQL but just getting in to SSRS so I may be missing an easier way to do it. I’m trying to get all the data in SQL and then use that in SSRS but if I should be doing more in SSRS and less in SQL I’m open to it!
Thanks for your input!
I ended up using a cursor to go through and pull each data point for each X/Y/Z type and inserting it into a temp table. Then I used SSRS to display it in a matrix. Sort of dirty but it works…