4
votes

This is my first time using the Microsoft Report Viewer control and I'm thinking it is very straight forward but I keep getting this following error:

 An error occurred during local report processing.
 The report definition for report 'Report3' has not been specified
 Object reference not set to an instance of an object.

I have a view from my Oracle Database that I am using that looks like this:

DataTable View

I walk through the GUI and make a "New Report" and add this DataSet to a "Table". I used the Query Builder to create the "FillByModel" and "GetDataByModel" functions and it all returns the correct data from the database but when I run the page that I have the ReportViewer control on, it gives me the above error. I have no idea what that error means and after Googling the crap out of it and trying everything I have no idea how to resolve it.

Here is the .aspx code for my ReportViewer object:

 <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt">
    <LocalReport ReportEmbeddedResource="Paint_Reporting.Report3.rdlc">
        <DataSources>
            <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="LOL" />
        </DataSources>
    </LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OnSelecting="ObjectDataSource1_Selecting" SelectMethod="GetData" TypeName="PaintModelNumberDetailTableAdapters.PAINT_MODELNUMBERDETAILLISTINGTableAdapter"></asp:ObjectDataSource>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

Could someone help me figure out this error?

2
do you have Paint_Reporting.Report3.rdlc file prepared? - rt2800
Yes, it is in my Solution. "Report3.rdlc" - se_brandon
Did you solve it? If not, post another question with the other error mentioning this one... - Leniel Maccaferri

2 Answers

2
votes

You must call this in your code behind:

reportViewer.LocalReport.ReportPath = "CommonLayer.Reports.SalesByPrice.rdlc";

Just make sure to change the names accordingly, that is, set reportViewer.LocalReport.ReportPath property to the path of the RDL file.

Here's a complete discussion detailing the options your have to workaround this problem:

The report definition for report 'xxx' has not been specified

0
votes

you also can add the exact path of your .rdlc

example mine it work to me:

reportViewer.LocalReport.ReportPath = @"C:\Users\miuser\Documents\Visual Studio 2012\Projects\miproyect\SSHD\Views\Summary\Report1.rdlc";