Home Subreports

Dynamically Creating TppImages

edited November 2005 in Subreports
I am attempting to dynamically create TppImage components on a subreport to
display images. I can get this to work on the first page, but when there are
more images than will fit on the first page, the report seems to get caught
up and creates endless pages.

If I statically place a certain number of TppImage components in my
subreport detail band, the report will successfully create a new page when
the image quantity needs more than one page. When I try to dynamically
create the TppImage components and assign images to them, I force a new page
just like in the static example - set the top below page so it runs out of
space but it doesn't seem to work. Any ideas?

Thanks,

Chris

Comments

  • edited November 2005

    - try setting Band.PrintHeight to phDynamic
    - then use the Band.BeforePrint to create/load the images



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2005
    Nard,

    Thank you for your response. The Band.PrintHeight is set to phDynamic and I
    am creating the images in the Band.BeforePrint procedure. When the first
    page is filled up with images, and it tries to go on to the next page, it
    gets lost and creates endless pages.

    Chris


  • edited November 2005

    If the Band overflows, then the Band.BeforePrint will fire again on the next
    page. Therefore it might be that the images are getting recreated over and
    over.

    In the DetailBand.BeforePrint check whether Band.OverFlow is true

    example:

    if not(DetailBand.OverFlow) then
    {create images}




    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2005
    Nard,

    I had already set a flag when I found out that BeforePrint was firing on the
    next page. I replaced it with the use of the OverFlow property and it still
    creates endless pages.

    Chris


  • edited December 2005
    I got it to work by changing the DataPipeline to the image records rather
    than the project so that there would be a DetailBand for every image rather
    than one DetailBand for all images in the project. I then set the Columns to
    5 in the ChildReport. Then, in DetailBand, I set ColumnTraversal to
    ctLeftToRight, and PrintHeight to phStatic. The images now print on next
    page fine.
  • edited December 2005

    Glad to hear you got it working :)


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.