This is a migrated thread and some comments may be shown as answers.

Conditional formating

3 Answers 221 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Emmsa
Top achievements
Rank 2
Emmsa asked on 20 Apr 2007, 09:04 PM
Hi i´ve started to try Telerik Reporting. I´m using SQL Reporting Server here.
I could not pass from SQL Reporting Server to Telerik Reporting without 2 things I consider very important:
* Declarative conditional formating (if percent == 0 the row is red if percent == 100 the row is green).
* Declarative filters like SQL Reporting Server.

I think that the 95 % of the configuration should be declarative and C# code should be writen in very special situations

3 Answers, 1 is accepted

Sort by
0
Orin Book
Top achievements
Rank 1
answered on 22 Apr 2007, 07:36 PM

I beleive I found the area for you to look to solve conditional formatting. In the help file, look under USing Report Events. However, this is very new to me.

For example, you can use the ItemDataBound event of a DetailSection to color alternate rows on a report:

private void detail_ItemDataBound(object sender, System.EventArgs e)
{
    Processing.DetailSection section = sender as Processing.DetailSection;
    if (i % 2 == 0)
    {
        section.Style.BackgroundColor = Color.PowderBlue;
    }
    i++;
}

0
Emmsa
Top achievements
Rank 2
answered on 23 Apr 2007, 06:49 PM
Thats not very declarative :P
0
Svetoslav
Telerik team
answered on 24 Apr 2007, 03:10 PM
Good work, Orin!

For the time being using the item events is the only way to implement conditional formatting. We've had several internal discussions whether to have some kind of declarative conditional formatting or stick to events. For the current report definition representation (the report is a .Net object that is being compiled) it seems that events are better because the event handler code will be compiled and most of the problems can be caught at compile time. Otherwise we will need to process the expressions at runtime and if there are problems we need to throw an exception and break the current report processing. Moreover such expression processing will add additional processing overhead and the profit is under question. The IntelliSense in the Visual Studio is worth much more.

As you can see there are lot of factors that matters and for the time being we decided to count on events.

 
Best wishes,
Svetoslav
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Emmsa
Top achievements
Rank 2
Answers by
Orin Book
Top achievements
Rank 1
Emmsa
Top achievements
Rank 2
Svetoslav
Telerik team
Share this question
or