New Blog Post: RESTful Reporting

Multi-Reports within one main report

edited September 2002 in Subreports
I am using ReportBuilder Enterprise version 6.03 on Delphi 6 Enterprise with
update pack 2. My database is the Advantage version 6.11 NT Server - 5 User
by Extended Systems. My OS is Windows XP Professional.

I am trying to create this multi-level subreport for a vehicle maintenance
application for a client. What I am running into is problems when running
the report.

I get some records containing sum detail information while others containing
none (these too have master-detail information. In addition to this want to
print out a equipment listing at the end for each vehicle (not at the end of
the entire report).

Here is my data structure (Simplfied and annotated):

VEHICLE (Master) Field: VEHICLE_KEY
|<-- VPURCHASE (Child to VEHICLE) Master Link: VPURCHASE_VEHICLE_KEY <->
VEHICLE_KEY [
|<-- VWARRANTY (Child to VEHICLE) Master Link: VWARRNTY_VEHICLE_KEY <->
VEHICLE_KEY
|<-- VMAINT (Master to VDTEAIL and Child to VEHICLE) Master Link:
VMAINT_VEHICLE_KEY <-> VEHICLE_KEY
|<-- VDETAIL (Child to VMAINT) Master Link: VDETAIL_VMAINT_KEY <->
VMAINT_KEY
|<--- EQUIPMNT (Master to EDETAIL and Child to VEHICLE) Master Link:
EQUIPMNT_VEHICLE_KEY <-> VEHICLE_KEY
|<-- EDETAIL (Child to EQUIPMNT) Master Link: EDETAIL_EQUIPMNT_KEY
<-> EQUIPMNT_KEY
|<-- EWARRANTY (Child to EQUIPMNT) Master Link:
EWARRANTY_EQUIPMNT_KEY <-> EQUIPMNT_KEY

I have defined my report in the same fashion. My Main tab hold the vehicle
fields in a VEHICLE GROUP. In my detail I added four subreports
(SubVPURCHASE, SubVWARRANTY, SubVMAINT, SubEQUIPMNT) Each on of these
subreports have been defined as pbChild in the PrintBehavior.

In the SubVAMINT I have a SubVDETAIL in the detail area (No group at this
level). Do In need one? In the SubEQUIPMNT I have defined two subreports
in its detail area SubEDTAIL and SubEWARRANTY.

What I am attempting it to generate different variations of reports from one
master report. The user will have a checkbox to select the level
information to add into the report, ie...VEHICLE only, VEHICLE with
VPURCHASE, VEHICLE without VPURCHASE but with VMAINT with or without
VDETAIL... and so on.

I am making sure RangeBegin at rbFirstRecord and RangeEnd at reLastRecord. I
have even define the MasterdataPipeline using the correct indexes for all
tables. I understand how to turn on and off (visible) selected SubReports
when requested by the user but here is the problem I am running into:

1) Not all SubReport Data is printing for each master record.
2) Error on subreport saying "No Data Found". I know there will be some
subreport tables which will not contain any data for it master table. How
can I get around from this error not bombing out the report when it runs?

Thank you,
John Antoniewicz
john@cybercove.com
Cybercove Consulting

Comments

  • edited September 2002
    There was a bug in the Advantage server 6.11 relating to bookmarks on the
    dataset. They fixed this and you should use Advantage 6.11a.

    There is a Subreport.Report.NoDatabehaviors property in which you can
    control how the report behaves when there are no records for it to print.
    The Subreport.Report object is a TppChildReport object and can be selected
    from the object inspector drop down or you can click in the greyed out
    report icon in the uper left hand corner of hte workspace inbetween the
    rulers.

    You can cause the master to skip a record when no details exists by setting
    SkipWhenNoRecords to true on the detail datapipeline.

    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.