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

Using Open Access Model (EntityDiagrams) as a datasource in a Telerik Report

4 Answers 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Richard M
Top achievements
Rank 1
Richard M asked on 06 Jan 2011, 04:06 PM
Can you send me 2 examples for using the Open Access model as a datasource:
1. Using the model as a datasource for Report1
2. Using the model as a datasource for crosstab1 in Report1

4 Answers, 1 is accepted

Sort by
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 06 Jan 2011, 04:19 PM
Check this video out: Binding Telerik Reports to OpenAccess

Cheers!
0
Richard M
Top achievements
Rank 1
answered on 06 Jan 2011, 05:04 PM
I will definitely check out this videos.  I can use your help with one specific problem I am having. I am trying to bind my Report1 from a linq query using the Open Access model.  Here is my code:

  public Report1 ()
  {
    InitializeComponent();
    this.DataSource = GetProducts();
  }

   public System.Collections.Generic.List<Product> GetProducts ()
  {
       AdventureWorksEntityDiagrams conn = new AdventureWorksEntityDiagrams();
       List<Product> results = (from c in conn.Products
                                            select c).ToList();
       return results;
   }

I'm sure it has to do with my GetProducts() method, but I haven't been able to figure it out.

0
Accepted
Massimiliano Bassili
Top achievements
Rank 1
answered on 07 Jan 2011, 05:36 PM
I don't see anything wrong with your code. What is the problem? If you expect that the report would pick up the data and autogenerate tabular layout for you - this is not how it works. You have to create a layout yourself and use proper expressions for the TextBoxes e.g. = Fields.MyColumn.

Cheers!
0
Richard M
Top achievements
Rank 1
answered on 07 Jan 2011, 08:10 PM
I apologize, you were correct and the code works fine.  Thanks for all your help. 
Tags
General Discussions
Asked by
Richard M
Top achievements
Rank 1
Answers by
Massimiliano Bassili
Top achievements
Rank 1
Richard M
Top achievements
Rank 1
Share this question
or