I am working on a SQL Server 2005 Reporting Services (SSRS) report that has differing row colors based on a value in each data row. The color value is defined in the database. When I initially created the report, each row had a variable background color but the foreground color was black. The first time I ran the report, my dark blue background didn't contrast well with my black foreground. I quickly realized that I needed a way to vary the foreground color programmatically based on the background color. After first discussing things over with Nate, here is the expression I came up with for the Color property of the table row:
=IIF(
((
((CInt(Fields!Status_Color.Value) And &HFF) * 299) +
((CInt(Fields!Status_Color.Value) >> 8 And &HFF) * 587) +
((CInt(Fields!Status_Color.Value) >> 16) * 114)
) / 1000) < 125,
"White",
"Black"
)
Let me explain where this all comes from. First off, the color that is stored in the database is used by a VB6 program. VB6 stores colors as BGR and .NET stores colors as RGB (well, technically aRGB). The first step is to break down the value from the database to its constituent parts (red, green, and blue) using bitshift operations I learned from Keith Peters and then apply the contrast formula I found from Colin Lieberman's website. I then determine that if the blackground is a dark color, then we use white and for a light background, black. This appears to working like a charm.
Don't forget when you update the RT_SiteConfig.pm file, you need to restart httpd. I was banging my head against the wall of this one until I had a moment of clarity.
Last night we purchase an Apple TV (as well as a Mac Mini, 20" Cinema Display Monitor, wired keyboard, and wireless mouse). Today I had the unfortunate happenstance of making this little gem of a unit find, and talk to iTunes running on my Mac Pro. I'll save you the gory details buy my switch is a Linksys SRW224G4P and in the end, I had to disable IGMP Snooping. Otherwise the multicast traffic wasn't flowing around correctly. This fix came as "well, let's just see if we turn the helper off". Well sure as shit, it worked. Yippee for me!









