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

Building a Outline Tree

edited September 2005 in RAP
Hello,

In a report i'm having up to 16 supreports, some of these are subreports of
subreports. The number of occurences of each report can change depending the
site the report is runned.
But i would like to create a Nice tree with some comprehensive titles.
I can use the OnOutLineNodeCreate but what is the way to 'know' what node
yoy are creating, what break is causing the Node creation and is there a way
to access the data at that moment so that i could create a correct title.

Ex

OverAll (with is the first subreport in the Main)
|- Charts (a subreport in the first subreport containt 4 teecharts)
|- Cost Overview (a subreport with 3 CrossTabs
|- Oppertunities (again 2 subreports)
|- Charts (2 Teecharts)
|- Figures (2 master detail reports)
|- Till Bar
|- Charts (a subreport in the first subreport containt 4 teecharts)
|- Cost Overview (a subreport with 3 CrossTabs
|- Oppertunities (again 2 subreports)
|- Charts (2 Teecharts)
|- Figures (2 master detail reports)
| Till Candy
...

It can happen that one off these tills has several subtills, then we first
print the 'master' till (summary) and than the detail for each subtill..

This structure would be great to have it in the OutLine !!!!!

Comments

  • edited September 2005

    I think the Sender parameter of the OnOutLineNodeCreate event is the Report,
    SubReport, or Group that is creating the node.



    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2005
    I'm afraid to make the stupid question of the day bit honestly i wouldn't
    know ...

    How do i access the Sender object in RAP, in Delphi code you get it as a
    parameter, but in RAP itself ???

    (Shame on me i suppose ????)

  • edited September 2005

    My mistake, I was not thinking about RAP not having access to the Sender.

    I created a patch for RB 9.02 that adds a NodeCreator parameter to the
    OnOutlineNodeCreate event for RAP. I will email it to you.


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2005
    How do i typecast this, becasue this results into errors ...

    if NodeCreator.ClassName = 'TppSubReport' then

    Node.Caption := Node.Caption + '[' + TppSubreport(NodeCreator).Name + ']'



    (In RAP), This is just for testing reasons ...... (i mean the .Name)

  • edited September 2005

    RAP has limited supported for typecast. When you use it in an expression
    like that, it does not work correctly.

    The solution is to use a local variable to store the typecast reference.


    var
    lSubReport: TppSubReport;
    begin

    if (NodeCreator is TppSubreport) then
    begin
    lSubReport := TppSubReport(NodeCreator);
    Node.Caption := '[' + lSubReport.UserName + ']';
    end;

    end;



    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com



    Best regards,

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