Home Subreports

Sub Select In Subreport ?

edited January 2003 in Subreports
Hi
I Need to Do the Following.

I Have a query that return Figures from a table for a month. This can be
either 4 or 5 weeks per month.
In this query I have a field PERIOD to indicate which week it is.

In another Table that I Query I get the 4 or 5 weeks different Budgets.
I Need to place the respective week's budget in the group for that week, an
the add the weeks figures(Actuals) an calulate the Deviation

The Problem is that all 4 or 5 weeks budget nou print in erery Subreport.
I Am translating this from Crystal Reports 7 and Delphi 5 Enterprize to
ReportBuilder 7 using Delphi 6 Enterprize
In Crystal it works fine as the link between the main report and the Sub
report is defined to do a selection based on PERIOD
How can this be done in ReportBuilder.

Edward Potgieter

Comments

  • edited January 2003
    I would do this with three datasets, linked master detail and use subreports
    to print the two detail datasets.

    The main dataset should be the data for each Month.

    The detail dataset (Week) includes the (linked by period) records for each
    month.

    Then another level detail that is missing is the Budget records linked to
    the Week dataset (linked by period, I'm guessing). This is just a lookup,
    which should return one record for each week? You can drop another
    subreport in the Week subreport's detailband to show the budget data for
    that week.

    Create a SUM calculated SQL field on the budget dataset in order to get a
    total for each week. This way you can easily use this value when calculating
    other stats.

    As an alternative, can you join in the Budget to the Week in order to have
    one single detail dataset? That may make it easier, depending on your
    preferences.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.