Home General

Subreport from second JIT pipeline

edited October 2011 in General
I am attempting to print invoices with scanned attachments after each
invoice. I did this with two separate reports, however, the invoice and
attachments merged with the invoice in the middle of five attachments.

So, I am now attempting to put a subreport at the end of each invoice page
using a JIT pipeline to hold the images (which are stored in a separate
table as a multi-image TIFF).

Trying to follow along with demo DM0136, I split out each image from the
TIFF and put them in an array of Tbitmaps. Now I know the number of images,
set plAttach.recordcount to that value, and then print the subreport which
is a single TppDBImage filling the page. I load the array and set
recordcount in the subreport's OnPrint event (I've also tried the OnGenerate
event of the header) and load the proper image in the pipeline's
OnGetFieldValue event.

The invoice (first page) prints file but the subreport with attachments
never print and the OnGetFieldValue never fires.

Is this doable? Is there a better approach or am I not setting up the
subreport at the right time?

Help would be appreciated.

Thanks,
Bill Skelton

Landmark Data Systems, Inc.
Two Old River Place, Suite L
Jackson, MS 39202-3435
601-362-0303

Comments

  • edited October 2011
    Hi Bill,

    Where is the subreport located in the main report (which band)? Are you
    sure the subreport itself is connected to a dataset?

    If you need to display a single image for each record in your main
    report, it may be easier to simply load that image manually for each
    record traversal rather than using a separate JITPipeline. For
    instance, in the Band.BeforePrint, based on the current field value,
    manually load one of the TBitmaps from the array into a TppImage component.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2011
    Thanks Nico for the quick response.

    The subreport is in the footer of the main page. I would do what you
    suggest in the second paragaph except I have multiple images to print for
    each single main page.

    I think my problem is in populating the pipeline. Again, the images are
    stored as multiple images in one TIFF row per main page. I can break them
    out to individual images ok, but I guess I'll have to put them in a
    temporary table in the DB and them read them as separate rows there. Would
    that work?

    Obviously setting the recordcount to 5 (for instance) doesn't cause the
    pipeline to traverse 5 rows that aren't there yet.

    Bill

  • edited October 2011
    Hi Bill,

    If you are using a JITPipeline, setting the recordcount to 5 will cause
    it to fire the OnGetFieldValue event 5 times (essentially traversing 5
    rows). It is up to you to implement the event and return the data the
    report is expecting.

    There are other events you can use for specific controls. For instance,
    if you place a DBImage control inside your report and connect it to the
    JITPipeline, you will want to implement the GetFieldAsPicture event and
    return a TPicture object so it can be displayed inside the report.

    On another topic, note that the footerband is not dynamic height meaning
    that it will not grow based on the size of the subreport you have inside
    it. You will need to either be sure the footer band is large enough to
    hold these images, or use a different band such as the summary or group
    footer.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.