2

I am trying to lay out an RDLC report for an ASP.NET application. I am using the entity framework and have a partial class that returns a list of entities generated from the EDMX designer. All files are namespaced correctly and in the same project to simplify the problem.

I am trying to work through the sample here: http://msdn.microsoft.com/en-us/library/ms251692(VS.100).aspx

...with the goal of rendering the report to the response stream in ASP.NET MVC via an ActionResult.

In the "Design the Report" section, on step 2 it says to select 'global', at which point my entity should be available. Unfortunately, there is no global and I can find no other way to reference the IList static method from my model.

Furthermore, it appears as though there is no way to add an object data source to the report (as in IDEs of yore) as there is no 'Data Sources' tool window.

There is a 'Report data' tool window, but there are no options to add a data source (other than if I wanted to create a DataSet, which I don't). If I use the dataset approach I cannot layout my report based on the objects generated from EF.

How do I add the entity reference (object data source) to the report so that it is aware of my model objects?

1 Answer 1

6

If anyone's interested, I was able to find a fix with the help of Raj Kaimal in the article Rendering an RDLC directly to the Response stream in ASP.NET MVC.

Raj's solution included making a wrapper object (the repository pattern). You can then report using EF objects, but you have to use a class with (optionally static) members that return IEnumerables. Build the solution so the designer is aware of the types, then add the repository result as the data source (and data set) to your report.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.