Custom Code

  • I'm pretty clueless when it comes to VB.net but I'd like to transform the following expression for the conditional coloring of cells in a column into custom code:

    =iif(Fields!ServiceTeam.Value IS Nothing,"White",

    iif(Fields!Median.Value>Fields!ServiceMedian.Value,"#d81e05","#009e49"))

    I'm aware that I need to create a function in the Report Properties-Custom Code and then call the function from the background colour property of the cell, but can anyone help me out please to get me started?

    Is there anywhere on the web that can help in converting Report Services expressions to VB?

    Many thanks.

  • Spend a few minutes searching here on SSC. There are several articles and blogs about using custom or embedded code in SSRS reports. I even recall an article (or article series) on custom color palettes.

  • Thanks - I have done, but didn't find anything that would help me specifically. I shall have another look though and let you know how I get on.

  • Hi

    I can see from a number of articles how conditional color formatting can be done in circumstances other than my own, but not against this part of the the original SSRS expression:

    iif(Fields!Median.Value>Fields!ServiceMedian.Value,"#d81e05","#009e49"))

    I could build a case statement into the original stored procedure and assign a flag where Median.Value>Fields!ServiceMedian.Value and use that to assign a color by value in custom code, but this is not the way I want to go at this time. i.e. I need the latter comparison to take place WITHIN the custom code. Is there a way to do this?

    As I've said, my knowledge of VB is zilch at this time and I'm in a bit of a rush. If I can get a basic hold on how to do this, I can apply it across all sorts of stuff (and do some VB study when I have time).

    Thanks to all in advance.

  • Try following this article: http://sqlserverpedia.com/blog/sql-server-bloggers/embedded-code-in-sql-server-reporting-services/[/url].

    MWise

  • Hi

    Thanks I'll take a look and report back.

    Cheers.

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

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