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

One page per record

edited November 2006 in General
Hi,

I am using Delphi 6 and ReportBuilder 9.03.

I have a the following master table Invoice

ID int
Mode string
Name string

And two client tables Breakdown
ID int
SeqNo int
Line string

and the table Attachments
ID
Seq No
FileName

I would like to have a report as follows. I tried it in several ways but I
cannot find it.
Per record in the table invoice I would like to habe one page with all the
fields of the Invoice table. But depending on the Mode I have 4 different
types of pages.
Per invoice record I can have a breakdown, this breakdown must be printed on
a seperate page.
And per invoice I can have one or more attachments. Each attachment must be
printed on a seperate page.

My bigest problem is how to get a different type of page for each invoice
record. I tried it with a subreport, but it seems that he only uses the
first type of page and not the others.

Thanks for all the advice.
Brdgs
Andre

Comments

  • edited November 2006
    Hi Andre,

    I'm a bit unclear about how you would like your report to look. Do you want
    to printe every record in the Invoice table first, then start printing the
    records from the Breakdown and Attachments tables 1 per page? Are these
    tables linked?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2006
    Hi Nico,

    I want to print every record on one page. But after every page (read record
    of the invoice table) I need to print the pages of Breakdown and
    Attachements. But some invoices do not have a breakdown or attachments.

    The breakdown and attachment tables have a master-details relation with
    invoice table.

    Structure:
    Invoice 1 (on one page)
    Breakdown page (on one or more pages, depending on the number of breakdown
    records)
    Breakdown 1.1
    Breakdown 1.2
    Breakdown 1.3
    Attachment page (first attachement of invoice 1)
    Attachment page (second attachment of invoice 1)
    Invoice 2 (on one page)
    Invoice 3 (on one page)
    Attachment page (first attachment of invoice 3)
    Invoice 4 (on one page)
    Breakdown page (on one or more pages, depending on the number of breakdown
    records)
    Breakdown 4.1
    Breakdown 4.2

    But the layout of the invoice page can vary by the type of invoice. I have 4
    different layouts.
    So I assume I have to design 4 invoice pages, 1 breakdown page (with
    master-detail) and 1 attachment page.
    And in one way or another link them all together to get it printed as one
    batch.

    Thanks for your advice.
    Andre


  • edited November 2006
    Hi Andre,

    If I understand correctly, you would like a master record on one page, then
    all the detail records on their own individual pages below the first page
    and so on. Something like the following...

    Page 1. Master Record 1 (Invoice)
    Page 2. Detail Record 1 (BreakDown)
    Page 3. Detail Record 2 (BreakDown)
    Page 4. Detail Record 3 (BreakDown)
    Page 5. Detail Record 1 (Attachment)
    Page 6. Detail Record 2 (Attachment)
    Page 7. Master Record 2 (Invoice)
    ... and so on.

    This can be done by creating groups for each primary key of each dataset.
    For instance, in your main report create a group with NewPage set to True on
    the Invoice ID. Then place two subreports inside the detail band of the
    main report, each connected to the detail datasets. Inside the subreports,
    create a group around their primary keys and set NewPage equal to True. Be
    sure to set the second subreport to shift relative to the first one.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2006
    Hi Nico,

    Thanks.
    I will try this out.
    Their is only one little difference in my example. All Detail records of
    Breakdown should be one on page (if it fits).

    Brgds
    Andre

  • edited November 2006
    Hi Nico,

    I was trying to figure this out. But the another important difference of
    your example against mine.

    Master Record (Invoice) must be print on one page per record. But I have 4
    different varieties of page depending on the field Mode of the invoice
    table.
    When Mode='A' then Page A must be printed for this invoice. If Mode='S' then
    page B must be printed is Mode='R' then page C and for Mode='T' page D must
    be printed.
    It sounds weird, but the invoice layout depends on the type of order. An
    order has a Mode field (A,S,R,T) and this decides what kind of invoice is
    printed.

    Brdgs
    Andre


  • edited November 2006
    Hi Andre,

    In this case I would recommend creating 4 different reports (one for each
    Mode) and saving them down as template files. Then based on the Mode field,
    load the proper template before printing the report.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2006
    Thanks I will try
    andre


  • edited November 2006
    Hi Nico,

    I tried that. But when I load the template when the form is created I see on
    of the invoice (depending on the mode of the first invoice). When I load
    the template when Before the detailed band is printed of the main report,
    then nothing happens.

    Can I switch templates on run time for multiple records.
    Maybe it is a solution to make a report for every mode and then create 100
    reports for 100 invoices. And then concat them together as one report. Is
    that possible. Because the user only once to see one report with all
    invoices in it.

    Brdgs
    Andre

  • edited November 2006
    Hi Andre,


    Yes, this would be one option in your case. Take a look at the Archive
    Merge Utility to automatically merge all the reports (saved as archive
    files) into one single archived report to print or view. The file is
    kuRAFMerge and it can be downloaded from our web site.

    http://www.digital-metaphors.com/download/report_component_library.html

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2006
    Thanks,

    I tried it. And it seems to be working oke.

    Thanks for all your help.
    Andre


This discussion has been closed.