简体   繁体   中英

Dynamic Grouping in stored procedure determined by SSRS

I have an SP, who's Count(ColX) changes depending on which column I am grouping by. I have 4 tables in a report in SSRS (VS 2013) that all use the this SP select, but each table will have a different count due to each table grouping by a different column in this SP.

Is it possible to keep one SP and group in this SP differently for each table this SP is called in in SSRS?

Eg Table A will group by ColX first, Table B will group by ColY first, etc.

If you mean that you have a single fixed stored procedure and you want to take the output from that and use it in four different tables in your report design, each grouping the data differently, then yes.

SSRS does not care where the data came from, the results of the stored procedure are passed to SSRS. Each table then determines how it will display that data.

Think of the tables in your report as SQL views. You can have a single database table and write many views over it, each giving you different output.

If this is not what you mean then my apologies, you've just wasted 30 seconds of your life reading this!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM