conditionally show different grids from different data sets?

  • I've got four queries which I've wrapped into four SPs. The queries all return different results sets in terms of the columns and the row count, so basically think of four totally separate and unrelated queries.

    I could produce four reports, however, if I wanted to produce just one report and give a user a drop down to choose which report to run how would I handle the fact that all the grids in SSRS would be different?

    I began thinking an easy option was one SP which had an additional parameter - i.e. if 'A' is passed run query 1, if B is passed run query 2. A-D could then be lashed up as a data set and parameters in the report looking to this. I don't see how this would work with different grids though.

    Does anyone have any ideas?!

  • Would be quite easy in reality.

    You would create your report as if you where showing all 4 data sets on screen at the same time, that way a the correct data set maps to a correctly formatted tablix /matrix etc etc.

    Then based on a parameter, you would toggle the visabilty of report objects, switching off say table B,C,D if the user selects A etc.

  • I sort of thought of that but I couldn't get my head around how I'd arrange the report. Surely if I had 4 different grids one below the other with toggle switches then when the last one was visible there'd be quite a gap at the start of the report?

  • The only gap you would get is if you leave any points between the tablix's, there wont be a massive gap between tables as the HTML is smart enough to realise its blank space and removes it as the object in theory "doesnt exist" at rendering time.

    I have attached a sample report, you will just need to change the data source to match a server and database on your side.

    As you can see there is a 5 point gap between the tables, which means that if you where to select D, you would end up with a 15 point gap between the header and the table. Obivously if there is no gap between the tables, then you dont get a gap between the header and table.

  • Funnily enough just after I posted that I had a little play around with some test data - as you say it's skipping stuff that's hidden, so in theory it looks like this would work a treat!

    I know I dabbled with Crystal a very long time ago and you needed to make the grids and then overlay one on top of the other and stuff like that (this was eons ago though and I didn't play much before someone jumps on that!)

    Thanks!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply