New Business Objects - defining child business objects in code

Stimulsoft Reports.WPF discussion
Post Reply
m.n
Posts: 33
Joined: Fri Jul 17, 2009 10:09 am

New Business Objects - defining child business objects in code

Post by m.n »

Hello,

Main BO has child BO. I do RegBusinessObject() against main BO and in Desinger.Wpf in Dictionary there is only main BO.
How can I add my child BO to dictionary in code instead of doing this manually in Designer?
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

New Business Objects - defining child business objects in code

Post by Jan »

Hello,

You can use following code:

Code: Select all

StiReport report = new StiReport();
            report.RegBusinessObject("Name", object);
            report.Dictionary.Synchronize();

            StiBusinessObject businessObject = report.Dictionary.BusinessObjects["Name"];
            StiBusinessObject child = new StiBusinessObject();
            child.Name = "ChildName";
            businessObject.BusinessObjects.Add(child);

            report.Dictionary.Synchronize();
Thank you.
Post Reply