XtraReports - BOs, Datasets or BO-> datasets ? Design time?


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Andy,

Glad it is working out for you and the web application.  I have plans to play with a web application, but have not had the time to get into it. 

I love SF, and feel pretty comfortable with their logic and design, specially after starting to use DevExpress controls and seeing they play nicely with the SF framework.

Edhy Rijo

Andrew Harper
Andrew Harper
StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)
Group: StrataFrame Users
Posts: 87, Visits: 3.3K
Hi Edhy,

I have integrated the report into a webform and it all works well - the immediate requirement was to provide an order confirmation print from a web page. I haven't had time to review the strataflix methodology in detail yet but will get to it eventually. My first major development in SF is all web based but about to start looking at rewriting a large app in Winforms. My experience so far has been good, most issues I have come up against have been more with learning .Net and Javascript. Data manipulation with the SF Bo's has been easy and a welcome relief from ADO having come from a Foxpro background,

Best regards,

Andy
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Andy,

Thanks for your assistance - much appreciated

Glad it worked!!! and again, if you have access to the StrataFlix sample, the logic used there worked out pretty good for me, even though at first, it wasn't clear how things where wired together, but as I acquire more experience in .Net them it makes more sense.  I started using Report SharpShooter which is not a very user friendly report engine, but now recreating all my reports with DevExpress was straight forward and I could re-used all my report data source classes and I was really great seeing that the special BBS wizard class worked perfectly with DevExpress also.

Edhy Rijo

Andrew Harper
Andrew Harper
StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)
Group: StrataFrame Users
Posts: 87, Visits: 3.3K
Adding the toolbox attribute and the "Imports" did the trick,

Thanks for your assistance - much appreciated,

Andy 
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
It is been a while since I create one BBS with the wizard, so probably you need to add the <ToolboxItem(True)> attribute to the class definition, here is a sample:

Imports System.ComponentModel
 Namespace Reports.CardListing
     <ToolboxItem(True)>
     Public Class ItemsBBS
         Inherits MicroFour.StrataFrame.Business.BusinessBindingSource(Of bizItems)
     End Class
 End Namespace


Edhy Rijo

Andrew Harper
Andrew Harper
StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)
Group: StrataFrame Users
Posts: 87, Visits: 3.3K
Thanks Edhy,

After rebuilding the solution I have a new tab on the Toolbox "XXX_ web components" where xx-web is the project name containing the newly created SF BBS.

This toolbox tab contains only 1 item - a BO of the same name that I specified when creating the SF BBS. The BBS is not shown in the Toolbox tab.

Hoping you might have some further suggestions,

Best regards,

Andy
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Andy,

I have been able to create the SF Custom BBS but do not know how to make it appear in the Toolbox. I have tried creating a new tab on the toolbox and dragging the bbs from the solution explorer but this hasn't worked.

Well the trick is to rebuild the solution, so they can show up in the ToolBox.

The report is destined to be displayed in a web app - have you had any experience using the reporttoolbar and reportviewer, as well as populating the datasource in a web environment?

Sorry I have not done any web application yet, but there are couple of videos in the DevExpress site that will show you that.  As for the datasource, it is the same as in WinForm, you should have a BO project that you can reference in the web application.

Edhy Rijo

Andrew Harper
Andrew Harper
StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)
Group: StrataFrame Users
Posts: 87, Visits: 3.3K
Hi Edhy,

Thanks for the detailed response. Initially I tried creating the sf BBS in the applications BO library project but this resulted in a pile of errors. Creating the BBS in the web application project has worked fine. 

I have been able to create the SF Custom BBS but do not know how to make it appear in the Toolbox. I have tried creating a new tab on the toolbox and dragging the bbs from the solution explorer but this hasn't worked.   

I have been able to add the SF BBS to the report by adding a standard BBS using the designer and then modifying the report code to use the SF BBS instead but clearly I am missing something here. I can now see the BO field list in the Xtra Report designer and can drag bound fields onto the report surface so I am making progress.

The report is destined to be displayed in a web app - have you had any experience using the reporttoolbar and reportviewer, as well as populating the datasource in a web environment?

Best regards,

Andy
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Andy,

That is a great question!!!

StrataFrame has a special BBS wizard for reports called "SF Custom Business Binding Source"  You can call it by adding an item to your project and choose the "SF Custom Business Binding Source".

The wizard will simply create a BBS based on a business object that you select, it can also create an inherited BO to be used by the report in case you need to add specific code like custom field properties that are only used by the report and the regular BO used for the forms.

When the wizard start do the following:
  1. Select the base BO that will be inherited.
  2. If you will need custom code for the report at the BO level.  I do this always because it separates the report's BO form the form's BO, then check the option to "Create a Reporting Business Object"
  3. Check the "Create a Custom Business Binding Source" so it will create the BBS for the report.
  4. Define a Namespace if you want to.
  5. Click OK button and you will end up with a nice BBS and its BO.
  6. Build the solution
  7. Now your BBS should be in the ToolBox and you can drop it in the XtraReport class.  Contrary to a BBS used in the forms, these does no need any BO assignment because that is done by the wizard, so the XtraReport will see your field definitions, but keep in mind that you cannot use the live preview in the designer, since the BO is not filled and there is no event in the designer that will allow us to load some sample data.
I am following the logic used in the StrataFlix sample for getting the data for the reports.  To run your reports, simple fill the data for the BBS.Source and show the report.  I have a ReportNameDataSource.vb file for each report as needed where I get the data for the report, here is a basic one, but as I said, I am following the StrataFlix logic, so feel free to check that sample out.
[codesnippet]
Imports MicroFour.StrataFrame.Business
 Imports CardTrackingSystem.Business
 Imports CardTrackingSystem.Business.Enumerations
 Imports CardTrackingSystem.Reporting.xrReportEngineNew
 Namespace Reports.CardListing
     Public Class xrCardListingDataSource
         Inherits xrReportDataSource(Of ItemsBBS)
         Public Overrides Function PopulateDataSource(ByRef rptParams As ReportParamsAs Boolean
             '-- Populates the data source using the specified Scheduled Date, Employee PK.
             Me.PopulateDefinedDataSource(rptParams)

             If Me.DataSource.SourceBO.Count > 0 Then
                 With CType(rptParams.ReportObject, xrCardListing)
                     '-- Update the report data source
                     .DataSource = Me.DataSource
                 End With
                 '-- Indicate that the data source was populated
                 Return True            Else
                 '-- There is no reason to continue since the browse was cancelled
                 Return False
             End If
         End Function

         ''' <summary>
         ''' Populates the data source using the specified primary key
         ''' </summary>
         ''' <remarks></remarks>
         Public Sub PopulateDefinedDataSource(ByRef rptParams As ReportParams)
             BusinessLayer.FillMultipleDataTables(ApplicationQueries.GetCardListing_Report(rptParams.CardCode, rptParams.CardName), Me.DataSource.SourceBO)
         End Sub
     End Class
 End Namespace
[/codesnippet]

Edhy Rijo

Andrew Harper
Andrew Harper
StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)StrataFrame User (280 reputation)
Group: StrataFrame Users
Posts: 87, Visits: 3.3K
Hi Edhy,

I have just started to look at Xtra reports and have a few queries about using a BBS. I have been able to get them to work with  datasets and have also explored the sqladapter approach referred to by Charles. I am hoping that you can clarify a few things for me.

I can add a BBS to an Xtra report in the designer but I am unable to add a BO - I get an error "The object that the business object is dropped on must implement microfour.strataframe.ui.windows.forms.iContainerControl". As a result I am unable to specify text.binding properties for the report labels at design time as you can't specify a BO for the BBS. Have you been able to do this in the designer or are you specifying the BO for the BBS and doing the databinding in code at run time? I am using VS2010 and XtraReports 11.

I suspect I am missing something obvious,

Best regards,

Andy
Edited 13 Years Ago by Andrew Harper
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