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

SubReport-Title

edited July 2004 in Subreports
Hello!

I have a small Report with a Detailband and a Two subreports (with the
same DatapipeLine)
In Subreport1 I do with RAP
Detail.Visible := Copy(Vormerkungen['VM_GFNR'],1,2) = 'AB';
and in Subreport2
Detail.Visible := Copy(Vormerkungen['VM_GFNR'],1,2) <> 'AB';

Everything fine, but I wrote a Header in the Title-Band of the
Subreport and this is ALWAYS printing. Now I would like to only print
this band when at least one Detail is visible.

How can I make this (the same problem with the summary).

Gruß aus den Bergen
Günter

Comments

  • edited July 2004

    Can you explain further. Is this a master/detail report. Are the subreport's
    set to pbSection or pbChild. Which subreport has the title - both of them?

    Have you considered creating separate queries for each subreport. The
    queries could contain only the relevant records.

    I think to determine when at least one detail will be visible you need to do
    some create a summary query or perform some summary calculations prior to
    generating the report.


    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2004
    In article <40ec312b$1@dm500.>, Nard Moseley (Digital Metaphors) wrote:

    It is Master/Detail
    pbChild
    and yes, both Subreports have their own title


    This will be the last solution.


    I would prefer, that no title/summary will be printed when no Detail is
    printed :) . I tried to set the Title.Visible in the Detail.BeforePrint but
    there it seams to be too late.


    Gruß aus den Bergen
    Günter
  • edited July 2004

    1. If each subreport were connected to a query that contained only the
    relevant records, then by default the subreports would not print when there
    are no related detail records.

    2. With the current data configuration you need to know in the main report's
    DetailBand BeforePrint event, whether there are any records for the
    subreport so that you can set the SubReport.Visible property. Its a timing
    problem. The only two solutions I can think of are:

    a. Add a couple of calculated fields to the master data that indicate how
    many detail records exist for each master record.

    b. Pre-process the data to count the number of detail records that exist for
    each master.



    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

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