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


Author
Message
Aaron Young
Aaron Young
Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)Advanced StrataFrame User (569 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
There is a lot of overhead that comes with using datasets for reports and I would avoid them if you potentially have large recordsets. As Edhy has mentioned, you can use a custom binding source instead which can be filled with all data in one pass for multiple enclosed business objects. If you allow your end-users to modify the reports, you can call one of the DevExpress End-User Report Designers and supply your filled custom business object as the data source. You can even re-use the custom binding source with grids to obtain parent child layouts which can then be printed via the DevExpress reporting system straight from the grid. This also gives the end user some control as they can filter the grid data, change sort, choose columns and even hide child bands before invoking a report from the grid itself.

Aaron
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
The first few reprots I did , I used plain old selects. Have now set up a report which uses a SP as the source and it worked fine. Advantage here is that , you still create a dataset, but you dont have to enter the Select stuff twice, just use the Stored procedure at design time and in the final Runtime app. You still need to put  a bit of code to 'Run' the app '. The code I have used is below. Also, I have tested using just one table but it 'Should' work for multiple tables......my next project when I get a bit of time...

// Instantiate Report and Show It using a Stored procedure
string connect;
SqlCommand command = new SqlCommand("dbo.sp_KmaSelectAll");
command.CommandType = CommandType.StoredProcedure;
connect = MicroFour.StrataFrame.Data.DataLayer.DataSources[""].ConnectionString;
command.Connection = new SqlConnection(connect);
SqlDataAdapter da = new SqlDataAdapter(command);
DataSet ds = new DataSet();
da.Fill(ds);
 
StockDetails01 rep = new StockDetails01();
rep.DataSource = ds;
rep.DataMember = "KMA";
rep.ShowPreview();



Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Charles, Gerard,

Hmmm, what a coincidence, 2 days ago I downloaded DexExpress to start testing their reporting engine, even though in version 10.2 they will have the MDI controller which will allow you to work with multiple reports at the same time.

The SF Business Binding Source wizard was designed with reporting in mind.  Reports don't read from a BO, but from a BusinessBindingSource (BBS) which is attached to a SF BO.  The wizard will also create a subclass of the BO you want to work with in case you need to add special coding just for reporting purpose and not to mix BOs created for forms.

With that in mind, I have been able to create a very simple report (not one2many yet) with a BBS and it works just fine, the only problem is that within the designer I am not able to preview the data since this needs to be generated by one of the FillBy methods in my BO.  I still need to figure out if there is a way to have the data available during the design.

I kind a like the approach used by DevExpress since they have a class file for the report.  Even though I am currently using RSS, I sill consider them not to be user friendly (at least at my level Crying) and also it looks like DexExpress has more resources to the development cycle to keep up with their tools.  They also have very good reviews and awards for their tools.

I am currently busy, but will continue to explore the DevExpress report and when I am able to generate at least a more complicate report I will try to post a sample.

Edhy Rijo

Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I was thinking the same thing about datasets but here is the problem :

I want to use the same methodology for all my reports and use stored procedures.

I will have a lot of reports where the dataset will hold more than one table.

I don't want to bring anymore records and columns than necessary over the wire and don't want to make any more trips to the server than i have to (some of my sql tables are quite large) 

I also *really* don't want to have to manually build the datasets if I can get the schema from the SP in the Add Datasource thingy in VS.  I'd prefer to pull parent-children-grandchildren in one sp if I can and still get the schema at design time from the sproc

Soooo ....

I'm really looking for a best practice way that is not going to involve writing 200 lines of code just to hook up the data for a report and is going to allow me to use the visual designer at design time.

How are you creating the datasets?  Are they strongly typed (does it matter?)  I'm thinking you may be right about the way to do this.  I'm not really that tempted by the BOs as from forum traffic at DevExpress I'm getting that hooking up iList stuff has its own challenges and datasets seem to be the native format.

I did find this post interesting :

http://forum.strataframe.net/Topic8417-6-1.aspx

and plan to study it more.
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Charles. I am going down similar route right now . I am inclined to go the route of datasets (outside of SF)  for a no. of reasons, however if there is a better way I am open to it.

1. Datasets seem to be the default datasource in Xtrareports

2. There does not seem to be a direct option to set a BO as a datasource for Xtrareports. I have seen a few examples where a BO is created and then data extracted out of the BO into a dataset. This seems to me to be Double Selecting and would take twice as long

3. Its not a big deal to create the dataset , and in our reports, there tends to be a certain amount of Pre-processing anyway

4. It seems to be easy enough also to set up multiple databases into a Dataset and then add a relation to relate parent to child

5. See sample below (only uses one Table and command string whereas a SP may be better). This more or less worked first time. In design mode, there is a certain amount of duplication in that I had to connect to my version of SQL in design mode, but this does not take that much time. I have the following code in the click event of a button on a form which will 'Run the Report' . I also plan on setting all my XtraReport up in a separate DLL, just to segragagte them out.

(Hopefully in the case of Multi Table reports, the above scenario will not go out the window !!)

// Instantiate Report and Show It
string connect;
string command;
connect = MicroFour.StrataFrame.Data.DataLayer.DataSources[""].ConnectionString;
command = "Select * from SMA Order by SMA_CUSREF";
SqlDataAdapter da = new SqlDataAdapter(command, connect);
DataSet ds = new DataSet();
da.Fill(ds);
CustomerDetails01 rep = new CustomerDetails01();
rep.DataSource = ds;
rep.DataMember = "SMA";
rep.ShowPreview();
.

Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
XtraReports 10.1.7

I would like to use SPs for all data retrieval for over 100 reports, many involving parent-child and even grandchild relationships and using detail bands rather than subreports.

I have a lot of questions, so bear with me and I'll be very grateful.

In VFP,  we were mostly limited to one detail band and the common practice was to flat-file the data and use grouping.

It looks like XtraReports, offering multiple detail bands, is happiest with actual parent child relational data, just as we would pull it for CRUD.

I love the idea of pulling all data for a report with one SP.  I send params defining set of parent records and use the list of pks of the selected parents to pull all relevant children - all in one trip using fullmultipledatatables().  ( in actual CRUD, of course, I usually just pull one parent at a time with its associated children, but in reports it would seem multiple parents and filterchildrecords() would be more common )

My first big decision seems to be : BOs or datasets or datasets filled from BOs

My main concern is how to have the structure available at design time for laying out the reports. 

If I'm just going to use the standard ADO stuff, I see I can use the dataexplorer in VS2010 and pick the sp as a datasource.  But it seems only the first table of a multitable sproc will get its structure into the treeview.  Is there a way to have the structure of a multitable sproc populate the treeview?  I would certainluy like to avoid manually designing each datatable in the dataset for each report.

If I use BOs, using fillmultipledatatables, can I see their structure at design time to design my reports? 

Do I need to make the child bos properties of the parent as in the RSS example ?  Wouldn't filterchildrecords() work?

Does XtraReports see a SF BO as an iList object?  What is the best way to handle SF BOs in Xtrareports?

I have considered the best way might be to use SF to deal with the sp, fill multiple BOs and then just grab their data at run-time to populate the dataset I will past to the report object, but that still leaves the question of design time what do I use for data in the designer when telling the report controls what they will be bound to?

I'm sure there is a lot more to ask but perhaps Peter and Bill and others who've been down this road can clear up some of my thinking so I can ask more intelligent questions on this.  I'm starting a really big project with it and I want to resolve some conceptual issues before going to far in the wrong direction

Thanks in advance
 
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