Page 1 of 1

Using interfaces in business objects

Posted: Thu Aug 26, 2010 4:49 am
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.

Using interfaces in business objects

Posted: Fri Aug 27, 2010 2:10 am
by Andrew
Hello,

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

Thank you.

Using interfaces in business objects

Posted: Fri Aug 27, 2010 3:39 am
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();

Using interfaces in business objects

Posted: Fri Aug 27, 2010 6:07 am
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();

Using interfaces in business objects

Posted: Mon Aug 30, 2010 1:19 pm
by Jan
Hello,

We need some time to fix this problem.

Thank you.

Using interfaces in business objects

Posted: Wed Sep 01, 2010 12:34 am
by Jan
Hello,

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

Thank you.

Using interfaces in business objects

Posted: Fri Sep 03, 2010 2:08 am
by Lavr
Jan wrote:Hello,

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

Thank you.
Great!

Thank you.

Using interfaces in business objects

Posted: Fri Sep 03, 2010 2:48 am
by Andrew
Ok! Have a nice day!