views:

389

answers:

1

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

A: 

I never did find way to do much conditional formatting with the ReportViewer control without it being dog slow so I deligated it to use for printing the list only. The default print view had no conditional formatting and a full view print will be rarely done and only by myself so I can wait a minute or two.

The prototype interface is being changed to a datagrid and the final project (Combining a bunch of small aps) is going to be moved to WPF.

Its a good that learning is one of the primary goals of these projects.

Mike B
It feels odd to answer my own question but, as I understand it, this is the correct thing to do here? Or should I delete it?
Mike B