Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

How do I resize image so dynamic text does not push to 2nd page?

My client wants a one page report. They need to be able to enter up to 200 characters that are included on that report. They also want an instructional image at the bottom of the page that is as large as possible given the remaining space.

The big problem is when they enter new lines in that text for formatting or just paragraph breaks, the image gets pushed to a 2nd page. How can I detect this in time to resize the image and keep it on the same page as the text?

Thanks,
Mike

Comments

  • BTW - I've tried resizing the image using the band's BeforeGenerate, but it's too late and the image ends up on pate 2.
  • Hi Mike,

    How is the text and image separated? Are they each in ShiftRelativeTo Regions, or Subreports, or separate bands? Are you using a one pass or two pass report?

    Simply shrinking the image can also be troublesome as it looses its clarity every time it is scaled. I would suggest shrinking the font of the text so it will fit rather than scaling the image. Then you could place the image in a static band such as the Footer Band and, knowing the space allotted, reduce the font size so the text is not cut off by the footer.
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • The text is a combination of DBMemos and regions. All with ShiftRelativeTo in use. The picture is also on a region. This is a two pass report. The text at the top must be the size it is. I don't have an option to shrink that unfortuately. If I could at least calculate the available height then I could show a 2nd or 3rd image made to more closely fit the available space.

    Thanks,
    Mike
  • Hi Mike,

    Try using the Region.OnPrint event to alter the height of the image. This being the region the image is inside. In my testing, this event fired early enough to successfully alter the image size.

    Since you are using a static font size for your text, you should be able to determine how many lines of text are needed to force a page break and resize the image hight accordingly.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
Sign In or Register to comment.