Conditional Formating top row of page

8 posts, 0 answers
  1. Donald McLean
    Donald McLean avatar
    20 posts
    Member since:
    May 2010

    Posted 03 Sep 2013 Link to this post

    I have a nice table all nicely formatted with one slight flaw. I have the column headers coloured blue and the a dark blue shaded top border and bottom border on the column headers. Now to make the table easier to read I used the conditional formatting to change every other row background colour to grey. It works beautifully except for one slight flaw, if the alternate row is at the top of the page the bottom border edge of column header row becomes extremely thin. So I thought if I could make an additional conditional formatting rule to account for the first row it would fix the issue however I can't seem to find of way of telling which row number starts at top of the page.

    I have my table in the group header section so that I can get my headers on every page and also so that I can group based on a column in the report and page break every time a new code is found. I was thinking I could also limit the number of rows per page so that it would fix that way making sure an even number of rows the issue would never happen. I attempted to do this, however I wasn't able to combine the two conditions, I keep getting error saying I can't have aggregate function in the group filter I was attempting to add "Int((RowNumber()-1)/30)"  to my existing group which is in the form = Fields.someField.

    Any help would be greatly appreciated.
  2. Squall
    Squall avatar
    174 posts
    Member since:
    Feb 2011

    Posted 04 Sep 2013 Link to this post

    You can use the RowNumber function to get the current row.

    SN
  3. DevCraft banner
  4. Donald McLean
    Donald McLean avatar
    20 posts
    Member since:
    May 2010

    Posted 04 Sep 2013 Link to this post

    Yes Squall I know that, I use it to shade every other row ie setting the expression to RowNumber() % 2 = 0. However it does not tell me if that row is at the top of the page.
  5. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 09 Sep 2013 Link to this post

    Hi Donald,

    Sections are sequentially rendered, where each new section top borders draw over the previous section bottom borders, as borders are not taken into consideration when the layout is created to avoid misplacing items. In addition borders are drawn half-in, half-out, e.g. 2px border will be drawn 1px inside and 1px outside the section/item without adding any padding or margin.

    For your scenario we can recommend the following approach illustrated in the attached sample report definition. In the Detail section we have added a Panel item with set conditional formatting rule to alternate its color based on the RowNumber. The Detail section has set Padding properties to move the Panel item in it 1px from the top and thus it is not drawn over the above section bottom border (by default the section's background is transparent).

    I hope this helps.

    Regards,
    Stef
    Telerik

    Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

  6. Donald McLean
    Donald McLean avatar
    20 posts
    Member since:
    May 2010

    Posted 17 Sep 2013 Link to this post

    I have my table in the group header section so I can have each group of codes start on a new page and I have no borders on any other rows I just want to have the row that has column headers to have a 2 pt Navy blue border top and bottom. The report looks great except for the odd page that has shading at the top of page which shrinks the border by 1pt and makes it look a little less professional.
  7. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 20 Sep 2013 Link to this post

    Hello Donald,

    Have you tested the suggested approach with Panel items. The same is applicable also for the Table/Crosstab item. In each detail row's cell add a Panel item and set its Padding.Top property to 2px. Then place in the Panel item a TextBox item and set the altering rows conditional formatting rule to the Textbox item.

    If you need further help, please elaborate on the report layout and the result from applying the suggested.

    Regards,
    Stef
    Telerik

    Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

  8. Donald McLean
    Donald McLean avatar
    20 posts
    Member since:
    May 2010

    Posted 14 Jan 2014 Link to this post

    I am working on the reports again, and I found that your solution works to keep the border from thinning. However then instead of highlighting the entire cell in the shaded colour it highlights just the words which looks crappy if it spreads over multiple rows.
  9. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 17 Jan 2014 Link to this post

    Hi Donald,

    Considering the way items are rendered, try to adjust the set padding and position the TextBox item in such way the padding is covered by the drawn border and the TextBox fills the rest space.

    Regards,
    Stef
    Telerik

    New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Back to Top
DevCraft banner