This is a migrated thread and some comments may be shown as answers.

Telerik Reporting sqlDataSource stored procedure multiple complex datasets returned

4 Answers 420 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
xi
Top achievements
Rank 1
xi asked on 07 Mar 2013, 09:10 PM
I've done a few reports using OpenAccess ORM that allow me to use a sql stored procedure that returns multiple datasets of complex type; however, I've been assigned to do these using EF5 only instead of using OpenAccess ORM since the rest of our app uses EF5.

The report is set up during design time and report params are assigned as sql stored proc params when the sqlDataSource is created. We are then using mvvm, so the report params are being passed in the viewmodel and then the report is run. I've successfully done this for reports using stored procedures returning only one dataset. However, I have not been successful figuring out how to configure a sqlDataSource with multiple data sets returned. It appears that the Data Explorer is only seeing the first return and the others cannot be accessed in any of the setups or explorer windows. I haven't been able to find any documentation to possibly set this in the viewmodel either.

Do any of you have any tips on how to go about setting up the sqlDataSource for multiple returns if this can even be done?

4 Answers, 1 is accepted

Sort by
0
xi
Top achievements
Rank 1
answered on 07 Mar 2013, 10:20 PM
btw I'm using Visual Studio 2012 with Telerik Reporting v6.2.13.110 and Entity Framework 5
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 12 Mar 2013, 12:58 PM
You said you are using EF, then why are you using SqlDataSource instead of EntityDataSource?

I believe that one DataSource works with one result set, so I guess you need to get the data from the stored proc into an object and then divide it into different data-sources and use ObjectDataSource instead.
0
xi
Top achievements
Rank 1
answered on 12 Mar 2013, 01:30 PM
Another one of our programmers handles the database model generation. I think he's using EF Code First along with a code generator project to create the models used in the project. I've only seen these work with tables and views. I'm not sure if they work with stored procedures. He doesn't seem to think Code First works with stored procedures so currently none of our stored procedures are pulled in as entities.

That's why I opted to use sqlDataSource for the reporting module of the project. I've read that you can manually program this in by tapping into the DataContext or ObjectContext? but then when the database gets recreated your manual code is overwritten. Our database will be regenerated a few times before our final design is complete, so I wouldn't really want to go this route unless nothing else can be done.

If I'm understanding you right, would I run the stored procedure and then return the results into an object which would then be split into manually created complex types objects returned from the store procedure? then use those manually created objects to source the report?
0
Stef
Telerik team
answered on 15 Mar 2013, 12:11 PM
Hi Xinia,

The suggestion from Hadib is correct. The SqlDataSource component will catch the result from only one select statement from your stored procedure, so if you need all tables, you can extract the records in custom DataSet/DataTable/DataAdapter objects and then use them with ObjectDataSource component - one per a component again.

In addition you can try Telerik Reporting OpenAcces ORM which has support for stored procedures returning multiple result sets.

Let us know if you have any further questions.

Kind regards,
Stef
the Telerik team

Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

Tags
General Discussions
Asked by
xi
Top achievements
Rank 1
Answers by
xi
Top achievements
Rank 1
Hadib Ahmabi
Top achievements
Rank 1
Stef
Telerik team
Share this question
or