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

Which Subreport is Printing?

edited April 2008 in Subreports
I'm trying to modify the name of the outline nodes. In the
OutlineNodeCreate event, I do I determine which subreport is being
printed? TIA.

Luke Miller
ResCorSoft, Inc.

Comments

  • edited April 2008
    Hi Luke,

    Based on what each subreport node is named, you can use the
    TppOutlineNode.ParentNode property to determine which subreport is printing.
    Something like the following...

    uses
    ppTypes,
    ppOutlineNode;

    lParentNode := TppOutlineNode(aNode.ParentNode);
    if (lParentNode.NodeType = ntSubReport) and (lParentNode.Caption =
    'SubreportX') then
    //Change node

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2008
    Thank you but I probably didn't explain myself well. I have a report
    that is composed of 8 subreports. The subreports are named rptSC1,
    rptSC2 ... rptSC8. With no changes the outline tree shows Main and then
    indented rptSC1. Under rptSC1 there are groups and page numbers.

    What I want to change is the captions of the subreport nodes. The parent
    node for all the subreports is the ntReportNode which doesn't really
    help me. While doing some poking around with your suggestion, I noticed
    that the sender when ANode.NodeType = ntSubReport is the subreport that
    is currently printing. So I'm good to go.

    Thanks for your help.


This discussion has been closed.