Long Report footer cuts fields on page break

Posted by: greghatfield on 4 August 2017, 3:04 pm EST

  • Posted 4 August 2017, 3:04 pm EST

    I am dynamically adding fields to the ReportFooter group in the DataInitialize event.  This causes the ReportFooter to be several pages long.  When the pages break the text in the fields sometimes cuts in half (part on each page).  What can I do to have the pages break correctly?  Attached is the report.


    Greg Hatfield


     


    2007/07/report.zip
  • Replied 4 August 2017, 3:04 pm EST

    I've taken a look at your code and can't find an obvious problem.  Splits in a text field can be caused by having fields with a different Top property or a different font size in the same row.  In your logic it seems that you are setting everything correctly.  It also appears that your format section logic is the same between the different group footers and the report footer. 

    Does this only occur in the Report Footer and never in the other sections?
    Does it occur every time the report is run, or is it a sporadic occurrence?
  • Replied 4 August 2017, 3:04 pm EST

    The group footer has the same problem.  It occurs every time the report is run.

  • Replied 4 August 2017, 3:04 pm EST

    Thank you for stiicking with me even though I have been out.  I set the cangrow property to false and it did not change the results.  Attached is a PDF of the printout showing how the cutoff creeps from page to page in the report footer.  Interestingly, the report footer also starts with only one line of fields before a page break.


    It didn't allow the PDF file attachment.  I have zipped it.


    Greg


    2007/07/Payroll Journal.zip
  • Replied 4 August 2017, 3:04 pm EST

    One thing I would try first would be taking out the
    'ReportFooter.Height =' line.  Since it is already set to cangrow, you
    shouldn't need to set it's height in the codebehind as well.  This may
    be causing some problems when it decides at what point to break pages.

    This may be a bit difficult to diagnose, since the logic used is to complex.  Would it be possible to provide a small sample application using a dummy database?  Perhaps the one you used to create the PDF document with?  This way I could try tinkering with a few different things and find something that works.
  • Replied 4 August 2017, 3:04 pm EST

    I removed the reportfooter.height line with no change.  Attached is a small project which runs the report with slightly different data.  Thanks for the help.
    2007/08/DataDynSmallProj.zip
  • Replied 4 August 2017, 3:04 pm EST

    It's solved by adding in two lines of code.

    ReportFooter.Controls.Item("txtSubTotalLabel_" & i).Height = 270
    ReportFooter.Controls.Item("txtST_" & i & "_" & j).Height = 270

    You need to set the height of each label explicitly. This corrects the problem.  I've attached the sample program with the necessary changes.

    2007/08/DataDynSmallProj2.zip
  • Replied 4 August 2017, 3:04 pm EST

    Thank you for your assistance.  That solved the problem.
  • Replied 4 August 2017, 3:04 pm EST

    Do the fields grow at all when the report is run? 
    If possible, could you set the CanGrow property to False? 
    It might also be helpful if you could attach a screen shot of the report when it is run to show exactly what it looks like were the split occurs.
  • Replied 4 August 2017, 3:04 pm EST

    Thank you for stiicking with me even though I have been out.  I set the cangrow property to false and it did not change the results.  Attached is a PDF of the printout showing how the cutoff creeps from page to page in the report footer.  Interestingly, the report footer also starts with only one line of fields before a page break.


     


    Greg

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels