Reporting Services: Can I Add Columns at Runtime?


A Reporting Services newbie here...Can I add columns to a report at runtime? I have some .NET datagrids that I add template columns to at runtime based on a datacolumn naming convention. I would like to do something similar in Reporting Services. Is this possible?

For example, I have this large query that returns data like:
UPC# - UPC Description - Store #1 - Store #2 - etc... I would like my report to have the "UPC#" and "UPC Description" as static columns, and then the ability to add a column to the report for each "Store".

If this is possible, and you can provide a snippet of how to do this, it would be greatly appreciated. If the answer is no this is not possible, then the reward is not so great :)

Thanks in advance,

Who is Participating?
Ken SelviaConnect With a Mentor RetiredCommented:
You can return

UPC#, UPC description, Store #1
UPC#, UPC description, Store #2

and add list with a matrix on the stores column.  Sorry I can't explain exactly how off the top of my head, but look at the adventureworks sample for an example. (It should be in the samples folder)

ppastorAuthor Commented:
Thanks, that IS pretty close, but how do I add a Column Header like "UPC Number" above the UPC# field? Also, I have a field which is the SUM of all Store values for each UPC. Any way to get that at the end of the row, instead of before the store columns?
Ken SelviaRetiredCommented:
Sorry I did not answer your last question. I don't have access to SRS this week so I could not do any tests.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.