Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I got this going with a bit of work using the <code>Lookup</code> function. This is 2008R2 and above only, but the fact that you're already looking at <code>Globals!RenderFormat.Name</code>, which is also 2008R2 and above implies this is OK.</p> <p>My first thought was to something like:</p> <pre><code>=Lookup(Globals!RenderFormat.Name , Fields!RenderFormat.Value , Fields!Color.Value , "Colors") </code></pre> <p>But this threw an error.</p> <p>However, as a workaround I set up a textbox in the report to display <code>=Globals!RenderFormat.Name</code> and then based the expression on the report item:</p> <pre><code>=Lookup(ReportItems!Textbox1.Value , Fields!RenderFormat.Value , Fields!Color.Value , "Colors") </code></pre> <p>For some reason this works fine where the other failed.</p> <p>You can set the textbox which displays the render format to hidden if required.</p> <p>Other options... Typically for styling you have the database approach which you're already using and doing this through embedded report code, or a DLL deployed on the server.</p> <p>Just embedding code in the report doesn't really help give you the dynamic styling you need, which leaves the DLL option.</p> <p>This would involve creating a DLL with some simple function that could return colour values based on a parameter, i.e. the render format global variable.</p> <p>The advantage with this is that there is only one code base so updating the DLL would apply it to all reports on a server.</p> <p><a href="http://www.sqlservercentral.com/articles/Reporting+Services+%28SSRS%29/65811/" rel="nofollow">This</a> blog post has some details on how to implement this with a server-side DLL.</p> <p>The disadvantage is that it's complicated and does involve getting the DLL running on the server, which is not always trivial.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload