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

Repositioning Sub (and/or) Main Reports

edited January 2008 in Subreports
Hello All !

I am using RB and Delphi 2007!

I am looking at a hypothetical situation. If I currently have a group of
reports, none of which have a sub report (i.e. Main Report only),
is it possible to do the following, and if so, what advice could you offer
to me?

1. Add a "simple" sub report with just a memo field with an initial visible
setting of "false" for the subreport
2. Insure that this new sub report can have its visible property enabled via
a "flag" set from within my app
3. Reposition the new sub report either further up or further down with
regards to it being before or after the "main" report at any time.

If anyone has any information about possibly doing this, I would really
appreciate it.

Regards,
Everett

Comments

  • edited January 2008
    Hi Everett,

    My recommendation would be to create a report with only a detail band.
    Place two Section style subreports inside the detail band (one for the main
    report, one for the sub report). These reports will print one after the
    other on their own pages and you can control their print order using the
    ZOrder property of the subreports.

    Another option would be to dynamically load saved templates into each
    subreport based on which order you want to view them.

    --
    Regards,

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

    Best Regards,

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

    Thank you very much for your reply! Both are excellent ideas !

    I have two last questions. First, can ZOrder be set dynamically via my app?
    (example?).
    Second, can someone lead me to an example of loading saved templates into a
    subreport (example?).

    Thank you kindly!

    Everett

  • edited January 2008
    Hi Everett,

    1. Yes, you can set the ZOrder by using the TppSubreport.ZOrder property.
    You will want to set this property before the report prints.

    2. There is an example of dynamically loading subreports located in the
    \RBuilder\Demos\3. EndUser\5. Dynamic Subreport Loading\... directory.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2008
    Thank you very much, again, Nico!

    I really do appreciate you pointing me into the right direction!

    Regards,
    Everett!
This discussion has been closed.