Click here to Skip to main content
14,883,098 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have just started RDLC reports but this is freaking me out.

I have a business layer class where a method returns a list of objects. I first created a report template (.rdlc file) and I mentioned that particular method. I got the fields in the object and I dragged them to the values portion in the report designer.

Next, I created a webform, and then I put a scriptManager and reportViewer in the webform. I chose my rdlc template and bound it to my reportviewer. The dataset was automatically bound using an ObjectDataSource. I did not have to bind the dataset.


XML
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt">
        <LocalReport ReportPath="Report3.rdlc">
            <DataSources>
                <rsweb:ReportDataSource Name="DataSet1" DataSourceId="ObjectDataSource1"></rsweb:ReportDataSource>
            </DataSources>
        </LocalReport>
    </rsweb:ReportViewer>

    <asp:ObjectDataSource runat="server" SelectMethod="getAllFaculties" TypeName="ERM.BLL.AcademicSetup.FacultyBL" ID="ObjectDataSource1"></asp:ObjectDataSource>



When I run this application, I get his error

An error has occurred during report processing. Cannot create a data reader for dataset 'DataSet1'.

Note: if I bind my ObjectDataSource to a GridView, it works perfectly. What am I doing wrong?
Posted
Updated 18-Aug-20 9:57am

Refer the link to create the rdlc report from scratch:

Microsoft Reporting without SQL Server Reporting Services[^]
   
It works for me. There is no correct answer post for this error. You have to enter the correct name with exact case. Example if Datatset1 then you should same case sensitive characters, not like DataSet1.
   
Comments
CHill60 19-Aug-20 4:16am
   
And yet if the OP binds that exact same data set to a Gridview it works - so the problem is unlikely to be the casing of the variable name.
Saying "It works for me" is not helpful without also quoting which versions of software you have installed - bear in mind this question was posted (and answered) six years ago - things might have moved on somewhat since then

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900