Page 1 of 1
Prevent report calling all object properties getter
Posted: Mon Sep 22, 2014 2:27 pm
by jakijim
Hello,
By default, when using list of objects in report datasource, report generator call all of object properties and even nested ones.
Sometimes calling an object property must done under some conditions. For example when calling property caused to generate and execute a database query, so this caused error when there is no suitable and open session to database.
In such scenario, it is necessary to prevent calling of such properties.
Is there any way to prevent report generator calling unnecessary properties?
Re: Prevent report calling all object properties getter
Posted: Tue Sep 23, 2014 9:42 am
by Alex K.
Hello,
Please try to use the RegBusinessObject() method for registration data for the report.
Thank you.
Re: Prevent report calling all object properties getter
Posted: Wed Sep 24, 2014 6:36 am
by jakijim
Hi Aleksey,
Thank you for reply.
Calling RegBusinessObject instead of RegData just result that only first level of object properties is accessible. What I need is getting only those properties needed in report. That may even include nested properties.
Thanks
Re: Prevent report calling all object properties getter
Posted: Wed Sep 24, 2014 7:24 am
by Alex K.
Hello,
Please try to use the following code:
Code: Select all
report.RegBusinessObject();
report.Dictionary.SynchronizeBusinessObjects(necessaryLevel);
Thank you.
Re: Prevent report calling all object properties getter
Posted: Wed Sep 24, 2014 8:14 am
by jakijim
Hi Aleksey,
Sorry if I didn't explain enough the issue.
In fact, I want report generator does not create a list of object properties. Instead, property getter must calls as requested. So there is no need to create a list consist tons of non-required and problematic properties.Suppose we pass a list of "object" (not a specific type) to report. So at run time, the report engine calls only the required properties that may be in any level.
In other words, In any level of object properties there may be both "required" and "non-required and problematic" properties.
Thanks a lot
Re: Prevent report calling all object properties getter
Posted: Wed Sep 24, 2014 11:25 am
by Alex K.
Hello,
In this case you can check which object are used in the report:
StiBusinessObjectHelper.GetUsedBusinessObjectsNames(report);
StiDataSourceHelper.GetUsedDataSourcesNames(report);
and register only necessary.
Thanky ou.