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

Conditional Formating top row of page

7 Answers 452 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Donald McLean
Top achievements
Rank 2
Donald McLean asked on 03 Sep 2013, 05:35 PM
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.

7 Answers, 1 is accepted

Sort by
0
Squall
Top achievements
Rank 1
answered on 04 Sep 2013, 07:15 AM
You can use the RowNumber function to get the current row.

SN
0
Donald McLean
Top achievements
Rank 2
answered on 04 Sep 2013, 11:57 AM
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.
0
Stef
Telerik team
answered on 09 Sep 2013, 02:23 PM
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.

0
Donald McLean
Top achievements
Rank 2
answered on 17 Sep 2013, 12:44 PM
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.
0
Stef
Telerik team
answered on 20 Sep 2013, 02:58 PM
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.

0
Donald McLean
Top achievements
Rank 2
answered on 14 Jan 2014, 06:42 PM
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.
0
Stef
Telerik team
answered on 17 Jan 2014, 06:07 PM
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.

Tags
General Discussions
Asked by
Donald McLean
Top achievements
Rank 2
Answers by
Squall
Top achievements
Rank 1
Donald McLean
Top achievements
Rank 2
Stef
Telerik team
Share this question
or