Search code examples
vb.netcrystal-reportsreportviewerrecord

How to always display 6 rows on every printed page in crystal report?


I have 3 rows in one table or 8 rows in one table. I want Report viewer always display 6 rows on every printed page. I found this on the web but it doesn't work with my case

if Remainder (RecordNumber, 6) = 0 then true else false

This only break after each 6 rows, but doesn't display 6 rows on printed page with case only 3 rows in on a table.(3 rows + 3 blank rows)

Example:

enter image description here


Solution

  • Found a way to cheat using the report footers (if you use groups you'll need to do this using group footers):

    First add 5 report footers:

    5 footers

    Then style these as per your detail rows (making sure Footer A, C and E are styled the same as your EVEN rows!):

    Row Style

    Set the suppression formulas as below:

    Footer A : Remainder(RecordNumber, 6) >= 2 or
               Remainder(RecordNumber, 6) = 0
    
    Footer B : Remainder(RecordNumber, 6) >= 3 or
               Remainder(RecordNumber, 6) = 0
    
    Footer C : Remainder(RecordNumber, 6) >= 4 or
               Remainder(RecordNumber, 6) = 0
    
    Footer D : Remainder(RecordNumber, 6) >= 5 or
               Remainder(RecordNumber, 6) = 0
    
    Footer E : Remainder(RecordNumber, 6) = 0
    

    This should then work as you need, if you use the Report Footer on the report add another and make it report footer F.