Prevent report calling all object properties getter
Prevent report calling all object properties getter
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?
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
Hello,
Please try to use the RegBusinessObject() method for registration data for the report.
Thank you.
Please try to use the RegBusinessObject() method for registration data for the report.
Thank you.
Re: Prevent report calling all object properties getter
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
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
Hello,
Please try to use the following code:
Thank you.
Please try to use the following code:
Code: Select all
report.RegBusinessObject();
report.Dictionary.SynchronizeBusinessObjects(necessaryLevel);
Re: Prevent report calling all object properties getter
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
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
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.
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.