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

Nested Reports?

edited July 2003 in General
Hi,
Not familiar with the latest versions of RB, still using RB5.54, but is
there a way to make a report, that is ready, as a part of another report...
Let me explain the question.
I have a box with parts of different types. There is a label with different
content for every part type. The size of that label is the same. Data for
those parts coming from different tables, according to part. The problem is
to print labels for all parts sitting in one box. Forghot to mention, that
box is also another table with references to tables with parts of different
types.
Currently to be able to print content of that box, I need to put all labels,
specific for all parts, into one ppReport, and then loop through box table,
getting info about every type, go to respective part table, get information
about it, find label on the report, fill all fields on that label with info
found. Number of fields on every part is different, so process of populating
label information is manual. Moreover, Report form becomes aware about all
tables and their fields with parts. I don't like it.
Now what I want to do:
My every part is an object. I could make this object to print its label.
Then, from the report with all labels for the box, I just run PrintLabel
method for every part in the box, get "preprinted" labels, and put them
together. But there's no component to insert this "preprinted" report. One
of the ideas was to use subreports, genereated on the fly, and then use
their Template property to populate content of those reports before
printing. I was trying to use ppArchiveReader to do that "preprint", but
then I realised, that it has other format and uses component other than
ppReport does - they are not compatible. My last hope is to regenerate
ppReport component from the file that ppArchiveReader can print, and use
that component to fill Template property, to implement "nested reports".

And finally - has anybody needed that also, has anybody done anything like
this. Is there any feature in the new versions, that could help me?

Please, don't point me to subreport, I know enough about them. My problem
with using subreports for my question is: data has to be gathered and put
together BEFORE you start printing. This breaks whole OOP concept in my
system, because ther's single report unit, that "knows" about many objects
in the system, but I want those objects to feed this report with data, not
report form get data from the database directly.

Thanks
Leon

PS: BTW, is RB thread safe? So far haven't found any issue with that, except
using ppDBRichText component, wich I can live without :)

Comments

  • edited July 2003
    Hi Leon,

    I am unclear about your data access. What type of database are you using?
    What are the properties of each of your objects that you plan to use with
    ReportBuilder. Do these objects act as controls that can be placed on a
    report or are they just a bridge for the data? By "nested" reports, do you
    mean you want to merge two reports together as one? I am a bit unclear what
    you mean when you say "preprinted" labels and doing a "preprint" with the
    ArchiveReader.

    The archetecture of ReportBuilder has not changed much since RB 5.54. The
    best way to access data from a database is still through a DataPipeline and
    the best way to "nest" a report inside another is using a SubReport. It is
    still best if data access and data processing occures before the report
    generates.

    ReportBuilder 7.02 is completely thread safe.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2003

  • edited July 2003
    Hi Leon,

    Thanks for the better explanation. I wasn't sure if it was possible to do
    what you described but I tried it and it seems that it will be. I created a
    small example application that first generates a .raf file by clicking the
    first button. Second, I was able to see what the archive file looks like
    using the Archive Reader by clicking the second button. Finally, I was able
    to generate the archive to cache using the archive reader again and then by
    accessing the draw commands from each page object, copy them to another
    report with a different background in the detail band by clicking the third
    button.

    You could possibly do something similar to this being careful that you
    position all the draw commands in the correct location on your main report
    so the archive pages look the same when they get transferred. Hope this
    helps.

    http://www.digital-metaphors.com/tips/ShowArchiveInReport.zip

    --
    Best Regards,

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