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

Set a Report with IEnumerable as DataSource

4 Answers 164 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marta
Top achievements
Rank 1
Marta asked on 26 Feb 2010, 02:00 PM

Hi,

I've been playing around with Telerik Report for just a couple days (basically reading the documentation and watching some videos) and have some questions. They are probable really basic questions, but since I didn't find so far an answer for them in the documentation nor by searching in the forum, I post them here.

I am trying to set a telerik report without having any DataBase conexion, so I thought on using a List (e.g. List<MyClass>) as DataSource.

How should I do this?

Until now, I added the DataSource programmatically, but then how do I connect the properties of the list elements (of type MyClass) with table/list/... cells?

Should I better define somehow the list as a project dataSource? how can I do this?

Does my approach make sense?

As I said at the beginning, I know these are probably beginner's questions, but I'm blocked!

Thanks!

Marta


4 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 26 Feb 2010, 03:30 PM
Hi Marta,

Open the Visual Studio examples and review the List Bound report example to see how to bind to a List datasource.

Kind regards,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Marta
Top achievements
Rank 1
answered on 26 Feb 2010, 04:02 PM
Hi Steve,

Thanks a lot for your answer! It worked!

Marta
0
Trelan Hylton
Top achievements
Rank 1
answered on 01 Mar 2010, 10:52 PM
Hi Steve,

This doesn't work for me, not sure why, but every time I try to bound the report to a Business Object (from another project ) with the data type being a DataSet(I also tried DataTable) it never binds. I try to do this through the Data Source Configuration Wizard. It (the wizard) sees the objects but when I go to Data Explorer, NOTHING. Why?

Also, I tried to do this programmatically as well.

             IISearchCaseReports _search = new IISearchCaseReports();

             DataSet _ds = IICaseReportsHandler.SearchAgingReport(_search);
             this.DataSource = _ds.Tables[1];

at which it tells me that "the requested database [db_name] is not defined in configuration." even though I set the connectionstring in the app_config.  
<add name="my__string_db_name"
            connectionString="Data Source=my_server;Initial Catalog=db;Persist Security Info=True;User ID=sa;Password=my_password"
            providerName="System.Data.SqlClient" />

what gives?

The only time I get data from the database is when I choose "database" from the dataconfguration wizard. I cannot use this however because our standards dictate that we use the business objects we create.

0
Steve
Telerik team
answered on 02 Mar 2010, 05:20 PM
Hi Trelan Hylton,

A thorough explanation of this scenario is present in my reply in this forum thread. Please review it carefully and let us know how it goes.

Greetings,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Marta
Top achievements
Rank 1
Answers by
Steve
Telerik team
Marta
Top achievements
Rank 1
Trelan Hylton
Top achievements
Rank 1
Share this question
or