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

Report Wizard Won't Let Me Use DAL

7 Answers 106 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chase Florell
Top achievements
Rank 1
Chase Florell asked on 19 Mar 2008, 04:28 AM
I am trying to generate a report, and the wizard is giving me an error.

Can anyone suggest how to overcome this issue while still using DAL's or do I have to use the builtin DB connection stuff?

Screenshot

7 Answers, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 19 Mar 2008, 09:09 AM
Hello Chase Florell,

As the error message says, the object you have chosen for the report data source is not of the expected type. For more information regarding the report data binding please see Connecting Data to a Report.

All the best,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Chase Florell
Top achievements
Rank 1
answered on 20 Mar 2008, 05:59 AM
Is this the way it is going to be or is there any possibility of change in the future.  I have spoken with one of my colleagues and he has said that it is a problem for him too.
0
Svetoslav
Telerik team
answered on 20 Mar 2008, 02:13 PM
Hello Chase Florell,

The problem is that the Telerik Reporting data processing engine expects (can work with) a limited set of objects which are the most common .NET data source objects. Because of the matter of the reports (you can think of the reports as data repeater or tables) this objects/interfaces usually describe a set (collection) of objects (the only exception here is the IDbDataAdapter interface).

If you need to use some other object as a report data source, create an array which contains only that object and pass the array to the report data source.

Kind regards,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Chase Florell
Top achievements
Rank 1
answered on 20 Mar 2008, 04:01 PM
I currently connect to my DAL using the following code.
Dim hp As New npoHouseholdsProvider()  
Dim hds As DataSet = hp.GetHouseholds_IDName_AsDataSet()  
Me.DataSource = hds.Tables(0) 

Could you maybe post an example on how to take that and store it in a data array that the reports would accept?
0
Chris
Top achievements
Rank 1
answered on 20 Mar 2008, 11:13 PM

The problem is that the Telerik Reporting data processing engine expects (can work with) a limited set of objects which are the most common .NET data source objects. Because of the matter of the reports (you can think of the reports as data repeater or tables) this objects/interfaces usually describe a set (collection) of objects (the only exception here is the IDbDataAdapter interface).

If you need to use some other object as a report data source, create an array which contains only that object and pass the array to the report data source.

Kind regards,
Svetoslav
the Telerik team

I hope you don't mind a little criticism, but that it won't take a datatable as a datasource... is pretty weak. I understand that you have to be limiting in the object types, and not accepting a custom object, I get.... but a datatable? It should be able to handle that much, shouldn't it?

-ca
0
Chase Florell
Top achievements
Rank 1
answered on 21 Mar 2008, 05:08 AM
Can anyone suggest how I can get that DAL stored into an ARRAY that the Telerik Report can use?
0
Svetoslav
Telerik team
answered on 21 Mar 2008, 02:43 PM
Hello Chris,

As the Telerik Reporting documentation reads:

Reports can use any of the following data sources:

  • Any component that implements IEnumerable, including System.Array, IList, ICollection, and BindingSource
  • Any component that implements IListSource, including DataTable and DataSet
  • Any component that implements ITypedList, including DataView and DataViewManager
  • Any component that implements IDbDataAdapter, including SqlDataAdapter and OleDbDataAdapter
This means that you can use any System.Data.DataTable (3rd point) as a report data source without the need of any transformations.

The only time you need to put an object in an array to use it as a data source, is if this object does not fall within the types described above (which obviously is not the case with the DataTables).

If you experience any problems with the DataTables as report data sources please open a separate support ticket and provide us with a sample report that illustrates the issue so we can examine it.

Kind regards,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Chase Florell
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Chase Florell
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Share this question
or