vb code examples for formatting report?

  • I'm looking to apply conditional font color formatting via vb code you call in a RS report, so I don't have to set the color property for each cell indivually. For example, I have one report with a LOT of columns and rows of formulas. I want to show negative numbers in red. Plus, in some cases a formula will return N/A  in which case I want to show it in gray instead of black. I would think there is a simple vb code looping structure that would do this. I don't do a lot of vb coding, just basic.

    Anyone have a good example. Is there a good site that focuses on good practical examples of vb code you incorporate into RS reports?

    Thanks

     


    smv929

  • This was removed by the editor as SPAM

  • Basically put, in the Color property box of the control you want to control put ...

    =IIF(IIF(Fields!yourFieldName.Value="N/A","Gray",IIF(Fields!yourFieldName.Value<0,"Red","Black"))

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

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

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