I am building a price list ap for use in my Business (in C# 3.5 using VS 2008 and WinForms) to replace an excel spreadsheet that suffers from 15 years of trying to get it to do things excel does not do well.
I am presenting the list in a ReportViewer. The report has about 650 rows and 17 columns. It loads very quickly without any conditional formatting but is getting quite slow as the formatting is added.
For example I have a format to color code the price of an item based on the date the items cost was last updated. The code I am using is:
=Switch(Fields!IsValid.Value="99" or Fields!IsValid.Value="3" or Fields!IsValid.Value="2","MistyRose",Fields!IsValid.Value="1","Khaki",Fields!IsValid.Value="0","Transparent")
There is formatting also for the color of the text and for some other columns. Loading this report is already taking the ReportViewer 15+ seconds to prepare the report on my dev machine so I hate to think how long it will take on a slower machine in the office.
I have tried changing the way the statement is formatted (Not using or statements, using IIf statements etc... I have also tried pre-calculating the values in a field instead so that the code looked like:
=Fields!PriceBackgroundColor.Value
Very simple... Not much faster (It did help a little)
Can anyone point me toward information on optimal formatting performance in a ReportViewer Control or suggest a solution.
Mike