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

Using EntityDiagrams to bind Reporting controls

2 Answers 49 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 08 Dec 2010, 07:55 AM
How would I create a function using my EntityDiagrams file and a LINQ statement, to bind to a textbox I wasnt to add to my Report?
I tried creating this function in Report1.cs:

public static string myFunction( )
{
MyEntityDiagrams1 conn = new MyEntityDiagrams1();
var getResults = from a in conn.Products
                             select a.Name;
return getResults.ToString( );
}

Then in the TextBox I add to my report, I right click, go to Expressions and choose myFunction( ), but I get an error when I try to view in Preview.

2 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 10 Dec 2010, 10:13 AM
Hi Richard,

Can you confirm that by EntityDiagrams you refer to Open Access? If this is the case, please review carefully the following help article: Retrieving data from an OpenAccess Model with the OpenAccessDataSource component that elaborates on extending the model and use it as data source through the OpenAccessDataSource Component.
Either way, your function would not work in Preview due to the fact it would not know where to get the connectionString from, but it should work at runtime.

Regards,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
Richard M
Top achievements
Rank 1
answered on 13 Dec 2010, 05:58 PM
That is very helpful.  Thank you very much.
Tags
General Discussions
Asked by
Richard M
Top achievements
Rank 1
Answers by
Steve
Telerik team
Richard M
Top achievements
Rank 1
Share this question
or