How to replace business objects in existing report

Stimulsoft Reports.NET discussion
Post Reply
olegtr
Posts: 16
Joined: Mon Mar 07, 2011 10:14 am

How to replace business objects in existing report

Post 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.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How to replace business objects in existing report

Post by Jan »

Hello Oleg,

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

Thank you.
olegtr
Posts: 16
Joined: Mon Mar 07, 2011 10:14 am

How to replace business objects in existing report

Post 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.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How to replace business objects in existing report

Post by Jan »

Hello,

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

Code: Select all

stiDesigner.InvokeRefreshDictionary();
Thank you.
Post Reply