Page 1 of 1

New Business Objects - defining child business objects in code

Posted: Thu Apr 08, 2010 4:37 am
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?

New Business Objects - defining child business objects in code

Posted: Thu Apr 08, 2010 9:24 am
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.