Business Objects structure not recognized correctly with XPO

edited January 2011 in FastReport .NET
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

Comments

  • diaswdiasw Germany
    edited 12:08PM
    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

    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.


  • edited 12:08PM
    Me too, having the same problem, so really in need of a proper solution

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.