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

Group By Five Rendering Issue

3 Answers 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 17 Jan 2011, 09:00 PM
I'm the first in our development group to try Telerik Reporting and like it a lot.  I've almost completed my first web project and have always found answers in the forums or your other resoruces but this one I cannot figure out.

I have a simple stepped report (best to keep it simple!) with multiple detail records:

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
...

My boss asked if I would break up the long listing (way longer than the 7 detail records above) into "vertical groups of 5" for better readability so it would look like:

Line 1
Line 2
Line 3
Line 4
Line 5

Line 6
Line 7
...

Basically, I would just add a blank line after every fifth row. 

So, I added one line at the top of the report class:

    Dim RowCount as Integer = 1

...and I added this code into the detail.itemdatabound event:

    RowCount = RowCount + 1
    If RowCount Mod 5 = 0 Then
       Me.detail.Height = New Telerik.Reporting.Drawing.Unit(0.4, Telerik.Reporting.Drawing.UnitType.Inch)
      Else
       Me.detail.Height = New Telerik.Reporting.Drawing.Unit(0.2, Telerik.Reporting.Drawing.UnitType.Inch)
    End If

I was delighted to see it work great in the Report Designer (both Preview and HTML Preview).  I was further delighted to see it work great in my web application "on the screen", however, when you print or export the report the blank lines are lost!

Please help!

I'm using the Q3-2010 Telerik Reporting with Visual Studio 2010.

Thanks,
Steve

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 19 Jan 2011, 05:44 PM
Hello Steve,

Instead of the event approach, our suggestion is to use Conditional Formatting with Style Edges Padding Bottom set to 0.2 in and the following filter:
 Expression  Operator Value 
 = RowNumber("MasterReport2") Mod 5  =  =0
 = RowNumber("MasterReport2")  <>  =1

About your approach - using the report item's definition counterpart is considered a hack with unexpected results. The sender of the event is always the processing counterpart of the data item. However for the current situation it's not applicable.

Check out the following help articles:

Greetings,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
Steve
Top achievements
Rank 1
answered on 19 Jan 2011, 06:52 PM
Your alternative worked great, thanks!
0
Doug
Top achievements
Rank 2
answered on 06 Oct 2012, 10:07 PM
I attemped this with Q2 2012 and could not get it to work.:

MasterReport2 refers to what? I thought maybe that is the name of the detail section so I tried

= RowNumber("detail") Mod 3  =  0
= RowNumber("detail")  <> 1

as the condtional formatting in the detail section.

What am I doing wrong?

This is a WinForm vb.net application


UPDATE:  I got it to work.  I removed the value "detail" from the function and it worked fine:

= RowNumber() Mod 3 = 0
= RowNumber() <> 1

Doug

Tags
General Discussions
Asked by
Steve
Top achievements
Rank 1
Answers by
Peter
Telerik team
Steve
Top achievements
Rank 1
Doug
Top achievements
Rank 2
Share this question
or