Business Objects structure not recognized correctly with XPO
Hi there
A while ago you helped me figure out a way to add XPO business objects as datasource in FR. For some reason I'm now starting to have problems again. Please refer to my sample project in the attachment. The problematic business object path is:
MeetingDocuments.Sections.StatusItems.RefersTo
As you can guess, "Sections" and "StatusItems" are both sub-collections, while "RefersTo" is a 1:1 association which can be Null. When you launch my demo app and try to execute the report in the designer, you will get the following error:
error CS0103: The name 'MeetingDocuments' does not exist in the current context.
The error can be fixed in one simple way: In my forms code, go to the method CreateSampleData() and un-comment that one line there. So the problem disappears if at lease ONE StatusInfo contains a value for "RefersTo". BUT... I can't rely on that! Sometimes all "RefersTo" properties will be Null and I still want the report to work.
BTW: You can also trigger the same problem if you uncomment the following line:
Config.ReportSettings.UsePropValuesToDiscoverBO = false;
--> As soon as that property is set to false, most 1:1 associations stop working (they're not expandable any more).
Can you please help me? My preferred solution would be to have FR recognize object structures correctly WITHOUT relying on property values. Instead, the structure should entirely be determined by .NET reflection.
Thanks in advance!
Marco
A while ago you helped me figure out a way to add XPO business objects as datasource in FR. For some reason I'm now starting to have problems again. Please refer to my sample project in the attachment. The problematic business object path is:
MeetingDocuments.Sections.StatusItems.RefersTo
As you can guess, "Sections" and "StatusItems" are both sub-collections, while "RefersTo" is a 1:1 association which can be Null. When you launch my demo app and try to execute the report in the designer, you will get the following error:
error CS0103: The name 'MeetingDocuments' does not exist in the current context.
The error can be fixed in one simple way: In my forms code, go to the method CreateSampleData() and un-comment that one line there. So the problem disappears if at lease ONE StatusInfo contains a value for "RefersTo". BUT... I can't rely on that! Sometimes all "RefersTo" properties will be Null and I still want the report to work.
BTW: You can also trigger the same problem if you uncomment the following line:
Config.ReportSettings.UsePropValuesToDiscoverBO = false;
--> As soon as that property is set to false, most 1:1 associations stop working (they're not expandable any more).
Can you please help me? My preferred solution would be to have FR recognize object structures correctly WITHOUT relying on property values. Instead, the structure should entirely be determined by .NET reflection.
Thanks in advance!
Marco
Comments
Hi Marco,
did you get it done? I'm having the same problem now and I think it is XAF-related, but don't get it to work. Using Devexpress 15.2 and current FastReport-Release, and cannot access 1:1-Objects in deeper paths.