Page 1 of 1

How to replace business objects in existing report

Posted: Mon Mar 07, 2011 10:22 am
by olegtr
Hi,
I'd like to know how to replace business objects in EXISTING report.
The situation is like this: we sometimes customize business objects for our clients (add properties), but once the report is created users don't see subsequent customizations.

This is what i do after i load existing report in the designer:
foreach ( var businessObject in businessObjects )
{
stiDesigner.Report.RegBusinessObject(businessObject.Name, businessObject);
}
stiDesigner.Report.Dictionary.SynchronizeBusinessObjects(10);


The business objects i register are the new ones, but this doesn't change anything in the designer and i still see the old business objects there, the ones that were used when the report was first created.


Thanks,
Oleg.

How to replace business objects in existing report

Posted: Mon Mar 07, 2011 2:09 pm
by Jan
Hello Oleg,

You need apply your code before loading report in report designer.

Thank you.

How to replace business objects in existing report

Posted: Tue Mar 08, 2011 3:03 am
by olegtr
Thanks Jan,
But i cannot do that.
Because before i load the report in report designer the stiDesigner.Report property is still null and thus my code will fail.

How to replace business objects in existing report

Posted: Tue Mar 08, 2011 6:32 am
by Jan
Hello,

In this case please call following method after updating report dictionary:

Code: Select all

stiDesigner.InvokeRefreshDictionary();
Thank you.