change the color each time the name of the server changes

  • hello ,

    I have a report ssrs which gives me the state of the backup

    I would like to change the color of the line at each

    I change the name of the server

    who has an idea on a tip that can answer my need

    Sans titre

     

     

  • it depends on what you are after. one of the most common requests is to change every  other row for readability.

    an example:

    https://www.mssqltips.com/sqlservertip/3490/alternate-row-background-color-in-sql-server-reporting-services-tablix-and-matrix/

    so in that example,the rownumber*() function needs teh Servername i think, instead of Nothing to change after each server name.

     

    =IIF(ROWNUMBER(NOTHING) MOD 2, "LIGHTBLUE", "SILVER")

    =IIF(ROWNUMBER(ServerNameColumn) MOD 2, "LIGHTBLUE", "SILVER")

     

    • This reply was modified 5 years, 5 months ago by  Lowell.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I tried I had this error

    =IIF(ROWNUMBER(Fields!Serveur.Value) MOD 2, "LIGHTBLUE", "SILVER")

    Sans titre

  • I would do the following:

    1. add another column to the query (DataSet)  with the following code:
    (DENSE_RANK() over (order by [Serveur]))%2 [n]

    it will enumerate all unique sql servers (column Serveur) with either 1 or 0

    2.  In the report use the following in FILL tab:

    =IIF(Fields!n.Value=1, "LIGHTBLUE", "SILVER")

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

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