Assigning a BO to BusinessBindingSource on XtraReport


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have got to figure out how to use a BO with the XtraReport effectively.  I have been able to drop a BusinessBindingSource on the report with no problem.  It is actually assigning a BO to the BindingSource that I'm having problems with.  I'd like to create a base report which I will be able to just inherit and use for my reports which come from BOs.  So, I'd like to be able to drop a BO on my inherited report and then set the BusinessObject property of the BindingSource to be that BO.  I'm having a couple of major problems with this and I just need to know what I have to do to make it work.

1.  When I try to drop the BO on the inherited report I get the error that it does not implement the IContainerControl interface.  What code do I need to implement for these routines to make this work correctly?  The BO still drops onto the form, but I'm sure it causes my other error.

2.  When I try to assign the BO to the BindingSource's BusinessObject property I get this error: "Unable to cast object of type 'BBS.Reports.BaseReport' to type 'System.Windows.Forms.Control'.  I'm sure I need to be doing something when the BO drops onto the form, but I'm not sure what will make all this work together.

If I can get the BindingSource to correctly work with the BO and the XtraReport so that I can use the BO fields on the report, I will be extremely happy.  Please help me get this working correctly.  Thank you in advance!

Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Any ideas on what I can do to resolve these issues?  I'm trying to write reports and it's becoming very cumbersome without being able to do these things.
Larry Caylor
Larry Caylor
StrataFrame VIP (1.9K reputation)StrataFrame VIP (1.9K reputation)StrataFrame VIP (1.9K reputation)StrataFrame VIP (1.9K reputation)StrataFrame VIP (1.9K reputation)StrataFrame VIP (1.9K reputation)StrataFrame VIP (1.9K reputation)StrataFrame VIP (1.9K reputation)StrataFrame VIP (1.9K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

I not familiar with XtraReports but use Active Reports and at first tried to do something similar to what you’ve described. After searching through the SF source to determine what it would take to implement IContainerControl in Active Reports and reading some related posts on this forum I believe it’s more trouble than its worth. It may not even be possible to get design time support for SF business objects in the Active Reports designer since they do not supply souce code and have some issues with inheritance. Maybe it would be easier in XtraReports????

 

Now that I’ve been doing it for awhile I find it’s very quick to layout a report in the AR, designer entering my BO field names while referring to an ObjectMapper window (got to love dual screensSmile).  Once I’ve designed the report, it's a simple matter to drop the BO and BindingSource on the SF form that I will run the report from. Then all I need to do is add the BO to the BindingSource, populate the BO, create a new instance of my report, set the report’s DataSource to the BindingSource and run/show the report.  It would be nice to be able to drop a BO on the AR report deisgner and have all the field names availabe in a drop down but probably not worth the effort.

 

 

 

 

 

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