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

SECTION STYLE SUBREPORTS WITH CRITERIA

edited December 2003 in End User
I am trying to construct a "batched" report consisting of 3 existing reports
to be prepared with a covering letter. Attempting to build a new report with
each of the existing reports in a section style subreport. My difficulty is
with passing criteria to the subreports.

In our app, users can define criteria for one or more dataviews - we store
these in a db table. When running the report, the user enters values for all
defined criteria. We store these parameter values, then retrieve the target
dataview(s) from the db table and assign a BeforeGenerateSQLEvent handler to
the OnBeforeGenerateSQL of each target dataview. The handler uses
TdaSQL.AddCriteriaField to append the criteria to the SQL for the dataview.

But .... when I run my new batch report it seems to disregard criteria for
sub-reports 2 and 3 - subreport 1 generates OK.

Do you have any code samples / tutorials that might assist me? e.g.
manipulation of class TdaSQL or use of BeforeGenerateSQLEvent. Or any
advice at all! The section in the Developer's Guide on section style
subreports using a single data pipeline - hopefully this isn't a limitation?
Found a bit in the online help that advises placement of subreport in
Summary Band of parent report - but doesn't seem to make any difference.
martin.ramshaw NO SPAM @wheatley-associates.co.uk

Comments

  • edited December 2003

    When you load the subreports the dataviews will be merged into the master
    report's TdaDataModule. There is only one DataModule for report - regardless
    of how many sections are contained in the report.

    Make sure that you are iterating through all of the
    TdaDataModules.DataViews[]. You will need to assign the
    BeforeGenerateSQLEvent handler to all dataviews.




    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.