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

Keeping Subreport Data Together

edited September 2008 in Subreports
I created Master/Detail report that is grouped:

In the Group header I have the master database display persons name, sorted
and joined to detail with an Unique ID key.
In the detail part of the report I created the subreport. The subreport has
detail data with Address info and Notes, notes are sometimes lengthy.

I can I keep the Address and Notes together? Notes someimtes overflows to
the next page and Address is on the prior page. I set the subreport
KeepTogether to True, but does not work. How can I kee the Address and Notes
field together?

Comments

  • edited September 2008
    Hi Bob,

    Which version of ReportBuilder and Delphi are you using? In my quick
    testing with a simple Master/Detail report, setting the subreport's
    KeepTogether property to True kept the entire subreport together across
    pages.

    Have you tried setting the Group.KeepTogether property to True instead?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2008
    Hi Nico,

    Using 10.9 and Delphi 7

    I also tried Group.KeepTogether and does not work.

    In the detail band I have 1 subreport. In the subreport I have 3 rows of
    data:

    Row 1 is some lables with fields to display.
    Row 2 has a Region with 2 rows of data, Row 1 has 2 fields with data, and
    Row 2 with a memo field. This region stretches up and down depending on size
    of memo.
    Row 3 Has another memo right below the region.

    Here is a sample data:

    Row 1 -> Name: John Doe DOB:01/01/1990 Age:18

    Row 2-> Position: Position is to be a manger of the group.
    Notes Memo: He has potential be a great manager
    with small groups.

    Row 3-> Additonal Notes: He also has the ability to be a great regional
    Manager, etc, etc, etc

    More Notes:He also has the ability to be a great National
    Manager, etc, etc, etc

    I want all 3 rows here to be together. Sometimes Row 1 is on page 1, and
    Rows 2 and 3 on page 2. Other times Rows 1 and 2 on page 1 but Row 3 is on
    page 2, etc.

    I would think it would be simple to keep it together. What lse can I try?


  • edited September 2008
    Hi Bob,

    If possible please put together a simple example that demonstrates this
    behavior and send it in .zip format to support@digitial-metaphors.com so I
    can take a look at it for you.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2008
    I used Region and put all the fields and memos on the region in the sub
    report and seems to work.

    I want to add a rectangle, shaded rectangle if I can, around PART of the
    subreport that has 2 fields and a strechable memo below it.

    First, can you have a shaded rectangle?

    I'm able to add rectangle around 2 fields and a strechable memo field below
    them, but the rectangle does not strech with it. Can this be done?


  • edited September 2008
    Hi Bob,

    Try setting the StretchWithParent property of the rectangle to True.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2008
    Hi Nico,

    I tried that and it does not work.

    I have

    Memo1
    ------------------
    |Field1 Memo2 |
    |Memo3 |
    ------------------
    Memo4

    All the above is on a region. I want the rectangle over Field1 Memo2 and
    Memo3 and strech with those fields. The Top of rectangle is right above
    Field1 Memo2 and if I set StretchWithParent to true, the rectangle covers
    Field1 Memo2, Memo3, and Memo4.

    Perhaps, I need to calculate the height of the rectangle as records are
    printed? Is there a way to get the TOP of Field1 Memo2 to BOTTOM height of
    Memo3 so the rectangle can be adjusted dynmically as records traversed?

    I also tried to put Field1 Memo2 and Memo3 on a another region with borders
    rather than rectangle, region within a region, but does not seem to work.


  • edited September 2008
    Hi Bob,

    Thanks for the further explaination.

    In this case you will most likely want to keep track of the position where
    Field1 and Memo2 begin and the position Memo3 ends, then manually add a
    TppDrawShape drawcommand to the report after the page has printed.

    For instance, you can check the Report.Engine.PrintPosRect.Top property
    after Memo1 prints for the top and the same before Memo4 prints. This will
    roughly give you the size and location of the rectangle which then gets
    created and added to the page after the page has generated.

    The following article shows how to add drawcommands to a page based on the
    PrintPosRect property value(s).

    http://www.digital-metaphors.com/rbWiki/Delphi_Code/Formatting/How_To..._Fill_a_page_with_lines

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.