0
votes

I have a problem with the asp.net webforms reportviewer controll. When I export from this control to excel, the xls cells background colors goes wrong. All cells background color inherits the last cell background color.

The pdf and .doc export working well.

I'm using this exp. in the .rdlc file for coloring the cells: =IIF(Fields!State.Value = 0, "#FFFFFF", IIF(Fields!State.Value = 1, "#00FF00", IIF(Fields!State.Value = 2, "#FFFF00", IIF(Fields!State.Value = 3, "#FF0000", "#808080"))))

I hope somebody can help me.

Bye!

ps.: Sorry my english.

1

1 Answers

0
votes

First, use Switch instead of IFF. Also, try giving the value in Color name like: Red instead of #FF0000

 =Switch(Fields!State.Value = 0, "#FFFFFF", 
Fields!State.Value = 1, "#00FF00", 
Fields!State.Value = 2, "#FFFF00", 
Fields!State.Value = 3, "#FF0000", 
"#808080")