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

How to keep together a TppRegion?

edited July 2011 in General
Hello,

maybe it is a silly question, but I am unable to keep a region together with
RB 12.04 Ent. Please take a look at my example:

I have a TppRegion with a TppLabel and a TppMemo in summary band. The
Caption of the Label is "Read this:" and the Memo has 2 lines "Memo Line 1"
and "Memo Line 2". Normally the report shows:

Read this: Memo Line 1
Memo Line 2

When there is a page break between the lines, the report should show the
whole region on the next page. But I am unable to reach this.

When I set Region.KeepTogether = true, nothing happens:

At the end of page 1:
Read this: Memo Line 1

on page 2:
Memo Line 2

Then I set Memo.KeepTogether = true and Region.KeepTogether = true. This is
not working:

At the end of page 1:
Read this:

on page 2:
Memo Line 1
Memo Line 2

I believe that is possible but I don't know how.

Thanks in advance for help.

Kind regards,
Gerd Brinkmann
invent GmbH

Comments

  • edited July 2011
    Hi Gerd,

    In my testing, the keeptogether feature of the TppRegion is working as
    designed. If the region becomes larger than the space available on the
    page, it moves the entire region to the next page.

    At what point are you setting KeepTogether to True? Are you setting it
    in code or at design-time. Are you loading templates? Is this a test
    app or your actual report?

    If you would like, send a simple example of what you describe below in
    .zip format to support@digital-metaphors.com and we will take a look at
    it for you.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2011
    Hello Nico,

    thank you very much for your fast replies to all of my questions. I will
    test your other answers tomorrow.

    I don't know how to send you an example. I have very big reports and they
    works with different pipelines. But it's possible to send the whole
    RTM-File.

    At the end I will copy an extract from the rtm-file, which not works. The
    word "Lieferbedingung:" and the first line ppDBMeno3 is on first page and
    the second line of ppDBMemo3 is on the second page.

    Here are two further informations to this code:

    1. In "SummaryBeforePrint" ppRegion6 is set to visible, whenn ppDBMemo3 is
    not empty.

    2. ppRegion15 is not always visible. May this is the problem...

    Thanks for your support and kind regards,
    Gerd Brinkmann
    invent GmbH


    object ppRegion6: TppRegion
    UserName = 'RegionLieferbedingung'
    KeepTogether = True
    Brush.Style = bsClear
    Pen.Style = psClear
    ShiftRelativeTo = ppRegion15
    Stretch = True
    Transparent = True
    mmHeight = 5027
    mmLeft = 3000
    mmTop = 40481
    mmWidth = 190000
    BandType = 7
    mmBottomOffset = 3000
    mmOverFlowOffset = 0
    mmStopPosition = 0
    mmMinHeight = 0
    object ppLabel5: TppLabel
    UserName = 'LblLB'
    HyperlinkEnabled = False
    HyperlinkColor = clBlue
    AutoSize = False
    Border.BorderPositions = []
    Border.Color = clBlack
    Border.Style = psSolid
    Border.Visible = False
    Border.Weight = 1.000000000000000000
    Caption = 'Lieferbedingung:'
    Ellipsis = False
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clBlack
    Font.Name = 'Arial'
    Font.Size = 10
    Font.Style = []
    Transparent = True
    mmHeight = 4233
    mmLeft = 3000
    mmTop = 40481
    mmWidth = 33000
    BandType = 7
    end
    object ppDBMemo3: TppDBMemo
    UserName = 'Lieferbedingung'
    Border.BorderPositions = []
    Border.Color = clBlack
    Border.Style = psSolid
    Border.Visible = False
    Border.Weight = 1.000000000000000000
    CharWrap = False
    DataField = 'ppLieferbedingung'
    DataPipeline = pipeWeitereDaten
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clBlack
    Font.Name = 'Arial'
    Font.Size = 10
    Font.Style = []
    ParentDataPipeline = False
    Stretch = True
    Transparent = True
    DataPipelineName = 'pipeWeitereDaten'
    mmHeight = 4233
    mmLeft = 38000
    mmTop = 40481
    mmWidth = 150000
    BandType = 7
    mmBottomOffset = 0
    mmOverFlowOffset = 0
    mmStopPosition = 0
    mmMinHeight = 0
    mmLeading = 0
    end
    end




  • edited July 2011
    Hi Gerd,

    As Nard mentioned in your other post, setting the visibility of a region
    without resetting the ShiftRelativeTo properties can cause numerous
    problems. I suggest creating a separate routine to loop through all
    regions in a band and reset the ShiftRelativeTo properties based on
    visibility.

    Please understand that unless we can re-create an issue here with a
    simple minimal example, there is virtually no chance to tracking down an
    actual problem with ReportBuilder. Complex reports such as yours can
    occasionally become difficult to manage. The best approach is to try to
    simplify the report by removing certain components and event code then
    periodically begin adding it back to find the problem.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2011
    Hello Nico,

    I think I can specify this problem:

    I made a summary band with the following elements:

    Region1 with DBMemo1
    DBMemo1.Stretch = true
    DBMemo1.Visible=true
    Region1.Stretch = true
    Region1.Visible=true

    Region2 with Line1 and below DBMemo2
    DBMemo2.Stretch = true
    DBMemo2.Visible=true
    Region2.Stretch = true
    Region2.Visible=true
    Region2.ShiftRelativeTo is Region1
    Region2.KeepTogether = true

    SummaryBand.PrintHeigth is phDynamic

    You see, everything is visible!

    My problem is, that I want to see Line1 and DBMemo2 always on the the same
    page! But this only works when DBMemo1 contains Data. If DBMemo1 is empty
    the page break can be between Line1 and DBMemo2 !!!

    Than I tried another constellation:

    No Region1
    DBMemo1.Stretch = true

    Region2 with Line1 and below DBMemo2
    Region2.Stretch = true
    Region2.ShiftRelativeTo is DBMemo1
    Region2.KeepTogether = true

    That works! Line1 and DBMemo1 are always on the same page!

    I don't want to say that there is a bug in RB. But it's a strange behavior.

    If you cannot reproduce this problem, I try to make an example...

    Kind regards.
    Gerd Brinkmann
    invent GmbH



  • edited July 2011
    Hello Nico,

    I don't want to say, that there is a bug in RB. I'm only looking for the
    best solution of my problems. This evening I will think about a solution
    without regions.

    Kind regards,
    Gerd Brinkmann
    invent GmbH



  • edited July 2011
    Hi Gerd,

    Please send a simple example of this to support@ in .zip format and
    we'll take a look at it for you.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2011
    Hello,

    your patch works! Thank you very much for your fast support.

    Kind regards,
    Gerd Brinkmann
    invent GmbH


This discussion has been closed.