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

Deleting PageStyle Band

edited July 2013 in End User
Hello,

Delphi XE 3, RB 14.08 Build 48

in older versions of RB we created in our Reportdesigner for the end
user automatically three PageStyle Bands on new reports.
Now since RB 12 (or was it 14?) the philosophy of PageStyle Bands has
changed. We are finding them now in the Tab PageLayer. Sometimes we have
now the problem if the user changing properties of one PageStyle Band,
the properties are changed at the wrong Pagestyle Band. I think there is
a problem if there are more than one PageStyle Band.
In most cases we only need one PageStyle Band. So we want that the user
is able to delete not used PageStyle Bands.
But if he click the right button of the mouse the delete menu is grayed
(disabled).
Can I anything programmatically do that the user is able to delete these
PageStyle Bands which we have created automatically in earlier RB versions?

Best wishes
Bernhard

Comments

  • edited July 2013

    In all RB versions prior and current you can do the following:

    1. Use the Report Designer to add/remove a page style band

    Select Report | PageStyle from the main menu

    2. Programmatically add/remove a page style band (same as for any band)

    // code to add a page style band

    myPageStyle := TppPageStyle.Create(Report.Owner);
    myPageStyle.Report := myReport;

    // code to remove a page style band

    myPageStyle.Free;


    RB 14 introduces Design Layers, which enable a report layout to be separated
    into logical layers. The PageStyle band is still there, but when you add a
    PageStyle band to the report, there is also a page layer added, because a
    pagestyle by definition prints as a background layer. Conversely if you add
    a page layer to a report and it does not already have PageStyle band, then
    the band is added automatically. A report layout can only have one PageStyle
    band, can have any number of page layers (which would be logically separated
    the PageStyle band elements into layers). A report layout can also have band
    layers.

    Here is some more info:

    Every report layout always has a Foreground layer. To add a background layer
    select the Designer Layers node in the tree view. Next, press the right
    mouse button and select either New Page Layer or New Band Layer from the
    context menu. A tab set will appear just below the report tree and just
    above the object inspector. Use the tab set to select a design layer for
    editing.

    There are two layer types: PageLayer, BandLayer. PageLayer represents
    elements
    in a PageStyle band and BandLayer represents elements in bands.

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2013
    Thanks for your answer. This is now clearer for me.

    But I have one further question.

    Can it be, that PageStyles which were added in earlier versions now all
    assigned to the same Designlayer.

    I have the following problem. If I delete a PageStyle with

    myPageStyle.Free;

    then suddently it were deleted two PageStyles (not only the one, which I
    want to delete) and it were deleted the DesignLayer.

    Is it possible per Code change the assigned DesignLayer. I want to add
    automatically for each PageStyle (which were added in earlier version) a
    separate DesignLayer, because now we have the problem, if I delete the
    DesignLayer, more then one PageStyle are disappeared.

    Best wishes
    Bernhard

    Am 02.07.2013 17:14, schrieb Nard Moseley (Digital Metaphors):
  • edited July 2013
    Have never heard of that. If you would like to create a test case that I can
    build and run here, please use standard Delphi components and RB. Send to
    support@ in zip format.

    Report and ChildReport descend from CustomReport and have the following
    structure

    CustomReport
    Bands[ ].Objects[ ]
    - where Band can be Header, Detail, PageStyle etc.
    DesignLayers[ ]
    - Foreground (default foreground layer)
    - DefaultPageLayer (default page style layer)


    For the report layout components such as Label, DBText, etc

    Component
    property Band
    property DesignLayer


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

    Best regards,

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