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

sub-report with many detail lines

edited February 2002 in General
Dear all,
I have a report running from pipeline1, pointing to a query with
only one record.
I want a sub-report which will show a number of detail lines from a totally
unrelated query which will have several records.

I have added a second pipeline pointing at my second query
I have put the sub-report in the summary band of the report, I have added
dbtext fields, pointing them to the second pipeline and query fields.
When I run the report I only get the first record from query 2 in the
sub-report.
How do I get many record lines to show?

regards
--
John Evans
Technical Director
Clear Advantage Ltd

Comments

  • edited February 2002
    How many records are returned in your second query? The second
    query/pipeline/subreport should print all of the records that exist in the
    pipeline. Is there a master detail relationship? I think you don't want to
    have M/D if there is no relation to use. If there are multiple records
    returned by the pipeline, then check a few things:

    1.Was the Subreport.PrintBehavior accidentally toggled to a fixed style
    subreport?-It should be a child or section style subreport.

    2.Check the Autostop property of the Subreport.Report

    3.Check the second datapipeline's RangeBegin, RangeEnd, RangeEndCount
    properties.

    Where is this subreport? Is it in the title/summary band? If it is in the
    detail band, then you'll need to build the second query dynamically to get
    the records that you want to show, emulating a master detail display of the
    data.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    Dear Jim,
    thanks for the response. The sub-report is a section. I have
    rebuilt the report now with two sub-sections. The first sub-report uses a
    pipeline with one record, the second has several records.
    The main report has no pipeline(which I understand is correct.). If I change
    it to be the second pipeline, then the report prints the first sub-report,
    then the first record of sub-report 2, then the first sub-report again then
    record 2 etc.

    I have built the report as closely as I can see to the example in the
    tutorial, putting 2 sub-reports in the detail section of the main report. I
    cannot see what is different about mine (except that it doesn't work).

    Autostop is set to false for the two sub-reports and true for the main
    report.

    Both pipelines are set to rbfirstRecord, reLastRecord and 0

    I am running RB standard version 5.0

    I do not understand your last point about emulating a MD display. If I have
    two sub-reports then they should both work independently.

    The pipelines are DBpipelines connecting to ADOQuerys.

    thanks for any more pointers, this is driving me nuts.

    --
    John Evans
    Technical Director
    Clear Advantage Ltd


  • edited February 2002
    When you disconnect the main report from any data, does it work like you
    want?

    If the main report is not connected to data, then its detail band should
    print once. The two section subreports then will only traverse their
    datasets once and then print those records. The subreports will print
    independently.

    Main Report Data: 0 records
    Detail 1
    begin
    Subreport 1 Data: 1 record
    Detail 1
    Subreport 2 Data: N records
    Detail 1
    Detail 2
    ...
    Detail N
    end




    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.