Conditional formating

4 posts, 0 answers
  1. Emmsa
    Emmsa avatar
    63 posts
    Member since:
    Oct 2006

    Posted 20 Apr 2007 Link to this post

    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
  2. Orin Book
    Orin Book avatar
    54 posts
    Member since:
    Sep 2006

    Posted 22 Apr 2007 Link to this post

    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;

  3. Emmsa
    Emmsa avatar
    63 posts
    Member since:
    Oct 2006

    Posted 23 Apr 2007 Link to this post

    Thats not very declarative :P
  4. Svetoslav
    Svetoslav avatar
    649 posts

    Posted 24 Apr 2007 Link to this post

    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,
    the telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top