Link to home
Start Free TrialLog in
Avatar of canuckconsulting
canuckconsultingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SSRS show background behind table

We have a subreport which has many columns corresponding to product sizes as shown below:

User generated image
Only the sizes relevant to the products being shown are displayed, all other columns are hidden.  These results in he report looking like this:

User generated image
We would like to extend the blue header row background across the page so the table looks better.  We've tried adding a blue rectangle section behind that header row but of course SSRS just pushes it down the report.  Is there a way to achieve what we want?
Avatar of chaau
chaau
Flag of Australia image

Why don't you display all sizes and make the background of the cell with value a different colour. In fact you can make different colours depending on the stock level: ie: normal - green, low level - red. That way it will be more user friendly: the users will always intuitively know what part of the screen to look for a size 10, an the colour will tell them straight away what stock is low or missing altogether.
Hi,

Try below solution. You might have write some custom code to set visibility of the column based on the data available for the product size.

You can achieve the same that you want to do.

I took the example to demo you. I have five columns and same way based on the values  i hided the column but at the same time i want tablix size to be mapped with the header.

I have five columns for data and also i have created other five columns. Set the visibility of those columns based on the data available for first five columns.

Let's if Column1 has black value and it's not visible at the same time make visibility of your first blank column to true. So it will always map with size of your header.

I have attached the report. Please go through.


If you wan to make data black just alter the query and set it make for any column.

SELECT 
 'Col1' Column1
,'Col2' Column2
,'Col3' Column3
,'Col4' Column4
,'Col5' Column5

Open in new window


Let's say if you want to make first column blank set it like.

SELECT 
 '' Column1
,'Col2' Column2
,'Col3' Column3
,'Col4' Column4
,'Col5' Column5

Open in new window


Hope it will help you.
Dynamic-Columns.rdl
Avatar of canuckconsulting

ASKER

Thanks to you both for the help.  

I neglected to mention an important aspect of the report; their are 70 available sizes so displaying each column so they can both be read and printed on US Legal landscape is not possible.  

chaau - That's why I'm hiding the columns, allowing the sizes to fit on the page.  I can't display all the sizes.


Arif - Same situation where I can't display the "placeholder" columns you suggest.  I simply don't have the space on the page.
ASKER CERTIFIED SOLUTION
Avatar of Arifhusen Ansari
Arifhusen Ansari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Arif thanks for the reply and sorry for the late response.

The problem is in your example you are always showing five columns which works great because you can show all five and they fit on the page.  In my case I have possible 70 columns which will not fit on the page.  For an order roughly a maximum of 20 are shown which do fit on the page.

So really I need the background to go across the page.  I think I can use your approach though.  I can have a number of blank buffer columns which i can display if there are less than 20 columns shown.  It's a bit messy though.  I was hoping there would have been something easier!

Thanks again for the help.