Current filter:
                                You should refresh the page.
                                0
                                  • Hi,


                                    I am using XtraReports with an XPO data source.


                                    I have the following class:


                                    public class Media : XPBaseObject
                                    {
                                    [Key(AutoGenerate = true), Persistent("MediaID")]
                                    public int ID;

                                    ...

                                    [NonPersistent]
                                    public Format Format
                                    {
                                    get
                                    {
                                    return _format;
                                    }
                                    set
                                    {
                                    SetPropertyValue("Format", ref _format, value);
                                    }
                                    }
                                    private Format _format;

                                    public Location Location
                                    {
                                    get { return _location; }
                                    set
                                    {
                                    SetPropertyValue("Location", ref _location, value);
                                    }
                                    }
                                    private Location _location;

                                    Location is:


                                    [OptimisticLocking(true)]
                                    public class Location : XPBaseObject
                                    {
                                    // All properties:
                                    [Key(AutoGenerate = true), Persistent("LocationID")]
                                    public int ID;

                                    [Persistent("ParentLocationRef")]
                                    public Location ParentLocation;

                                    [Size(20)]
                                    public string Name;

                                    [Size(80)]
                                    public string Description;


                                    The Format class is not persisted:


                                    public class Format
                                    {
                                    public string Name { get; set; }
                                    }


                                    The properties of the child object of the persisted Location class are visible, the properties of the child of the NonPersistent class are not visible. (Format -> Name - See attached screenshot)


                                    How can I make properties of simple (POCO) classes accessible in the Field list of the End User Report Designer?


                                    (I found a couple of questions and answers regarding child collections but not a solution for child objects.)


                                    Thanks!


                                    Joern




                                Field list.jpg
                                • Currently, I am unable to reproduce the problem you described. I have created sample project, which works correctly on our side. Please review it.

                                • Joern G. 06.25.2012

                                  Hi Elliot,
                                  thanks for the sample!
                                  To reproduce the problem, please change the line:
                                              r.DataSource = new BindingSource() { DataSource = new Media() };
                                  to:
                                              var collection = new XPCollection<Media>(XpoDefault.Session, false);
                                              collection.Add(new Media());
                                              r.DataSource = collection;
                                  Best regards,
                                  Joern

                                • Thank you for your clarification. I was able to reproduce this problem on our side. I will forward this issue to our R&D team, and we will contact you as soon as we get any results. Please bear with us.

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Hi Joern,

                                Please add the "NonPersistent" attribute to the Format class to avoid this problem.

                                	
                                [C#]
                                ... [NonPersistent] public class Format { public string Name { get; set; } } ...

                                Thanks,
                                Elliot

                                • Joern G. 06.26.2012

                                  Hi Elliot,
                                  perfect! Thanks!!!
                                  Joern

                                • Thank you for your feedback.

                                  I am glad to hear that the issue has been resolved. Please contact us if you experience any further difficulties.

                                You must  log in  or  register  to leave comments
                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.