Using interfaces in business objects

Stimulsoft Reports.NET discussion
Post Reply
Lavr
Posts: 14
Joined: Thu Aug 26, 2010 4:19 am
Location: Ukraine

Using interfaces in business objects

Post by Lavr »

Hello!

Some years ago I used your great reports in our projects. All was good because we bind them to the DataSets and Tables.
Today I changed work place and started new project. I want to use Stimulsoft here, but has some problems:

I can't bind report with BusinessObjects that contains Interfaces as return types in properties.
Here is the code:

Code: Select all

public class Test 
        {
            [DataMember]
            public virtual Biz CurrentBiz { get; set; }
            [DataMember]
            public virtual Product CurrentProduct { get; set; }
            [DataMember]
            public virtual ITeam CurrentTeam { get; set; }
            [DataMember]
            public virtual ICompany Customer { get; set; }
            [DataMember]
            public virtual IPerson CustomerPerson { get; set; }
            [DataMember]
            public virtual string CustomerRef { get; set; }
            [DataMember]
            public virtual Guid? Status { get; set; }
            [DataMember]
            public virtual string DeliveryPoint { get; set; }
            [DataMember]
            public virtual Guid? PaymentTerms { get; set; }
            [DataMember]
            public virtual string Notes { get; set; }
            [DataMember]
            public virtual Subsidiary OrderFor { get; set; }
        }

.....

            var rep = new StiReport();
            rep.RegBusinessObject("CRM", "Container", new Test());

            rep.Dictionary.SynchronizeBusinessObjects(3);
            rep.Design();
When executes rep.Dictionary.SynchronizeBusinessObjects(3); I get NullReferenceException.

What I do wrong?

Thanks in advance.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Using interfaces in business objects

Post by Andrew »

Hello,

Thank you for the post. We will check and let you know about the result.

Thank you.
Lavr
Posts: 14
Joined: Thu Aug 26, 2010 4:19 am
Location: Ukraine

Using interfaces in business objects

Post by Lavr »

Interesting info:
If I wrap my class in to the generic list, i.e. List then all data registering correctly:

Code: Select all

            var rep = new StiReport();
            rep.RegBusinessObject("CRM", "Container", new List());

            rep.Dictionary.SynchronizeBusinessObjects(3);
            rep.Design();
Lavr
Posts: 14
Joined: Thu Aug 26, 2010 4:19 am
Location: Ukraine

Using interfaces in business objects

Post by Lavr »

One more:
Exception appears if I send initialized list, i.e. list that contains at least one element:

Code: Select all

            var rep = new StiReport();
            rep.RegBusinessObject("CRM", "Container", new List { new Test() });

            rep.Dictionary.SynchronizeBusinessObjects(3);
            rep.Design();
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Using interfaces in business objects

Post by Jan »

Hello,

We need some time to fix this problem.

Thank you.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Using interfaces in business objects

Post by Jan »

Hello,

Problem fixed. Patch will be available in next prerelease build.

Thank you.
Lavr
Posts: 14
Joined: Thu Aug 26, 2010 4:19 am
Location: Ukraine

Using interfaces in business objects

Post by Lavr »

Jan wrote:Hello,

Problem fixed. Patch will be available in next prerelease build.

Thank you.
Great!

Thank you.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Using interfaces in business objects

Post by Andrew »

Ok! Have a nice day!
Post Reply