BusinessBindingSource


Author
Message
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

I’m using BusinessBindingSource as a data source for Active Reports. Everything works fine as long as the Business Object that I’m assigning to BusinessBindingSource does not contain any custom properties. If I add a custom property, Active Reports does not map the report fields correctly.  This happens even if the custom properties are not being mapped to an Active Reports fields.  Just having the custom properties defined in the BO causes Active Reports to incorrectly map data. I’ve added the custom property descriptors using the GetCustomBindablePropertyDescriptors override and the BO works fine when binding to Windows forms. It appears that something is not working correctly when the custom properties are handeled by BusinessBindingSource.

-Larry

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Does the report form throw an exception?  Or does the problem manifest itself in other ways?
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

The report runs, but the information that appears in the fields is messed up. I haven’t looked at it fully in debug yet but it appears to try and use other elements within the BindingSource as data fields. See attachments. The only difference between the business objects that were used as the input to BindingSouce for both cases is the addition of four custom properties to the one that causes the error.  I’ve run into this before but just worked around it by eliminating the custom properties in the objects I use for reporting.

-Larry

Attachments
BindingSourceError.png (120 views, 23.00 KB)
BindingSourceOK.png (121 views, 23.00 KB)
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
That error is certainly strange... I wonder what mechanism ActiveReports is using... reflection, ITypedList, not sure.  Probably the only way to fix it would be to debug it.  You might try setting break points in the .Item property of the business object and the Gets of the properties that are being evaluated.
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

I’ll give it a try when I get some free time. Unfortunately Active Reports does not include source code.  In the meantime I can work around the issue by creating additional BOs for reporting.

Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K
Here is some additional information on the mechanism that Active Reports uses. According to Data Dynamics, any class that implements the IList interface may be used as a data source.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Well then there should not be any issue because if you use the BusinessBindingSource to wrap a BO, then the IList interface is implemented.  We will look into this more, but this interface is implemented.
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K
That's what I thought. Just to give you a little more info, the custom properties that I've added are readonly and are populated by scalar methods, so there are no actual columns in the underlying data table.

-Larry

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Well, I will have to test this.  But basically what will happen is that the scalar method will be executed once for every row since the IList interface basically emits its own BO for each row so the strong-typing works properly.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search