Using .NET Class as the DataSource with SSRS RDLC

前端 未结 2 546
醉话见心
醉话见心 2021-02-06 05:51

I have a MVC4 application in Visual Studio 2010 which contains plenty of classes. I\'m trying to use them to pass in as the DataSource for a Report Definition Language Client (

相关标签:
2条回答
  • 2021-02-06 06:39

    Solution: Delete all contents and folder from Bin and Obj folder from your project directory and rebuild your solution.

    I faced the same problem in Visual Studio 2015 with ASP.NET MVC5 when adding Data Sources of RDLC Report. Everything was working well when adding Data Sources in my current project. But suddenly in new reports I wasn't finding my project desired/updated/new classes as Data Sources in RDLC report data.

    When I deleted all the contents from Bin and Obj folders of the current project, everything started working again

    0 讨论(0)
  • 2021-02-06 06:47

    Here are a couple solutions, but I prefer the second one.

    Solution 1 (okay)

    As this appears to be a bug with the MVC Web Application project type itself, you can add the report to a different project type (like Class Library). As described in the post Visual Studio 2010 Report Viewer - Object Datasource, just create a separate library for the project and add the rdlc file there. The data source configuration wizard should now look like this:

    data source configuration wizard

    Solution 2 (better)

    As figured out in Can't see or add Website Data Sources in RDLC report in ASP.NET MVC, you can just add an aspx page anywhere to the MVC project to trick Visual Studio into pulling in the right design time libraries.

    Just do the following:

    • Close all windows
    • Clean & Rebuild Solution
    • Add WebForm1.aspx to the Project
    • Open up the RDLC file and choose a DataSource from the dropdown:

      DataSource Dropdown

    0 讨论(0)
提交回复
热议问题