简体   繁体   中英

reportviewer How to make rectangle background transparent

I have 3 rectangles that differ from each other in opacity. The base color is same for all of them. For eg: the base color could be Red and the three rectangles would have the following colors: Red, Red (opacity: 55), Red (opacity: 135).

I tried setting the Background Color of the rectangle but it seems I cannot change the transparency of a rectangle. Is there a workaround for this?

Thank you!

It turns out that this is a limitation of reportviewer. Opacity values can be given to only gauges and graphs. Shapes and fonts do not accept opacity values. A close workaround to this is to add the opacity value to RGB. For example: if I want to generate a color in RGBA as (255,0,0,160) , I should add 255-160=95 to the values of G and B to get a color close to my needs. Therefore the color turns out to be (255,95,95) . It is not the exact color but it is close. I tried this for red, blue and green colors since those are the only colors I need.

I hope this helps someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM