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

Get the pagenumber where a subreport is printed

edited July 2011 in Subreports
Hi.

I have a question and I hope you have a simple answer for me ;-)

I have one report with header, detail and footer.

On the detailband there are many (I think 20 or more) subreports.
On the footer band are 3 regions.

The 3 regions should get printed on every page.

To this point theres no problem.

But now I need to print another content in the footer of that page
where one Subreport is.

For example: I need on every pagefooter the content X, only on that
page where ppsubreport15 is printed, there I need the print not content
X, I need content Y.

Its very difficult to explain.

Best regards
Michael

Comments

  • edited July 2011
    Hi Michael,

    You could place two subreports (containing the different versions of the
    footer information) inside the footer band, then inside the specific
    subreport's OnPrint event, toggle the visibility of the two accordingly.
    Be sure the toggle back once it is finished.

    Best Regards,

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

    Thanks for your answer.

    It seems it doesn't work. My report is very complex.

    At the moment my report has 4 pages.

    On page 1,2 and 4 should get printed "X".
    On page 3 is my "SubreportY" and on this page the footer should print
    "Y".

    If I now scroll over the pages it doesnt switch the content.

    Is there perhaps a function which I can use, so that I can write at the
    onPrint-Event of the footer:

    if IsOnMyPage(SubreportY) then begin
    Show Content Y
    else
    Show Content X



    Nico Cizik (Digital Metaphors) formulierte Donnerstag :
  • edited August 2011
    No ideas ?

    Michael Meyer schrieb am 28.07.2011 :
  • edited August 2011
    Hi Michael,

    What type of subreports are you using? Child, Section, Fixed?

    Subreports are dynamic in that they can span across pages. There is no
    way to know when a subreport is going to start after another has
    finished and to be sure it is on a new page.

    If you are certain that Subreport Y will always print on page 4, you can
    us the OnStartPage event of the main report to toggle the content in the
    footer.

    Also, try tracing any events you are implementing to give you a better
    idea what is happening and why.

    Best Regards,

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

    All Subreports are "Child".

    The Subreport which is important for that has also "KeepTogether" =
    True.
    So I am sure it is only on one page.

    So I think I must make "try and error".

    Best regards
    Michael Meyer

    Nico Cizik (Digital Metaphors) stellte die Frage :
  • edited August 2011
    Hi Michael,

    The main idea is to toggle the visibility of the content in the footer
    band before it is generated. You could use SubreportY or perhaps event
    an event of a component inside that subreport to do so.

    If you would like to send a simple example to how your report is
    currently behaving that I could run on my machine, I would be happy to
    look at it for you. Send any examples in .zip format to
    support@digital-metaphors.com.

    Best Regards,

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

    I have just send a simple example which is like my real report.

    Best regards

    Michael Meyer

    Nico Cizik (Digital Metaphors) machte diesen Vorschlag :
This discussion has been closed.