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

EOutlineError when working with PageStyle reports

edited January 2010 in General
Hello,
I'm working with PageStyle reports and with a certain report I'm getting an
EOutlineError, when I "add" the PageStyle report to the main report.
The error message is:
"TppPage.AddDrawCommand: Cannot add more than one draw outline command per
page."

I can't explain it to myself or find a reason so far. Other PageStyle
reports, which are made in a similar manner, do work.

What could be the reason for the problem?

Regards,
Mark.

Comments

  • edited January 2010
    > What could be the reason for the problem?

    can you create a small demo and set it to support?

    Ed Dressel
  • edited January 2010
    Hi Mark,

    Try to isolate the differences between this report/project, and the others
    that you do have working correctly. Are you creating certain
    components/drawcommands at a different time perhaps? Are you using
    different components all together?

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2010
    >> What could be the reason for the problem?
    Hi Ed,
    it's mostly a bit difficult to create a demo with the same behaviour, since
    it oftens requires a more or less exact copy (a small one) of the whole
    project...
    Especially since I don't know what parts, events, functions etc. could cause
    the issue.

    I still wasn't able to figure out the difference between the reports which
    do work and which don't.

    But I will try to make such a demo / find time for it.

    Thanks for your reply.
  • edited January 2010
    Hi Nico,
    I still wasn't able to figure out the difference between the reports which
    do work and which don't.
    The only drawcommand I'm creating is the one for the watermark, but that's
    the same in both cases.

    ...
    ...

    Now, 1-2 hours later after starting to write this message, I probably found
    the reason:
    My PageStyle-Reports do have a fixed band (Summary), which has a fixed size,
    which I set by code:
    Report.SummaryBand.Height := Report.PrinterSetup.PaperHeight -
    Report.PrinterSetup.MarginTop - Report.PrinterSetup.MarginBottom;

    Looks as if the SummaryBand of the "broken" PageStyle-Report has a larger
    height than the result of that calculation. It can happen through changing
    of the page margins. Previously they were 6,35 for the "Top" and "Bottom".
    If I change the margins to a larger value (15 or so), the height of the
    summary band remains the same, i.e. is larger than it should be.

    While I can preview this report only without any problems, it leads to the
    mentioned error once I merge the main report and the pagestyle-report.

    Once I reduce the height of the summary band of the PageStyle report and
    merge them afterwards, it works again.
    I think that's something, which should happen automatically within the
    designer once there is a band with a larger height than the result of the
    calculation above. It isn't happening automatically (yet, I hope), so I need
    to do it by code.

    Here is my question, how I can achieve that? I.e. when can I react and
    adjust the height? There is no event like "OnPageSetupDialogClose" or
    something like that. How can I do that?

    Regards,
    Mark


  • edited January 2010
    Hi Mark,

    When do you set the height of the summary band? It looks as though you are
    doing this before you are adjusting the margins of the main report. If this
    is the case, you could possibly use the Template.OnLoadEnd event to manually
    change the height of the summary band inside the "PageStyle" report before
    the report is printed.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2010
    Hi Nico,
    the situation was the following:

    - a PageStyle report and a main report got designed with the same margins -
    everything worked.
    - then the margins of the main report got changed due to some rethinking of
    the concept
    - some new PageStyle reports got designed with the current margins -
    everything worked
    - while trying to merge the new main reports with some of the old PageStyle
    reports (old margins), the error occured.

    In the process of looking for the reason I noticed, that adjusting of the
    margins for "top" and "bottom" doesn't change the height of a band (summary
    in my case) automatically, so despite the fact, that the height should be
    smaller now (= .PaperHeight - .MarginBottom - .MarginTop), it's possible to
    save a report, wich has a bigger height that the height determined by the
    user.

    This should be checked by RB by default in my opinion. Something like that
    is already happening when margins "left" and "right" are being changed.
    There appears a warning, that there are objects on the reports, which would
    be out of range after the change etc. The designer offers to delete them.
    Somethink like that should happen for the margins "top" and "bottom" too and
    the objects could be moved up or down according to the differenz.

    This wasn't working, so initially I was looking for a proper event to check
    this and adjust everything myself. That's what I asked about first. For now
    I made the changes one step later, i.e. when I'm going to save the template.
    I check all this and adjust the height and move the elements. Seems to work.

    Actually at that point I wasn't even thinking about the need to make such
    changes when merging a main report and a PageStyle report as well. That's
    what you meant, I think. I did on that place the same what I did in the
    designer and it seems to work too.

    So actually only the question about the event to react to the changes in the
    PageSetup dialog directly is still open.
    Unless there are any objections on what I'm doing :)

    Regards,
    Mark


This discussion has been closed.