Microsoft ASP.NET Report Viewer

This is my first time using the Microsoft Report Viewer control, and I think it is very straight forward, but I keep getting the 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 look at the GUI and create a "New Report" and add this DataSet to the "Table". I used Query Builder to create the “FillByModel” and “GetDataByModel” functions, and they all returned the correct data from the database, but when I launch the page on which the ReportViewer control is installed, it gives me the above error. I have no idea what this error means, and after Googling got rid of it and tried everything I don’t know 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> 

Can someone help me figure out this error?

+4
source share
2 answers

You should call it in your code behind:

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

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

Here is a detailed description of the parameters that you should solve this problem:

Report definition for report "xxx" not specified

+2
source

you can also add the exact path to your .rdlc

my example it works with me:

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

Source: https://habr.com/ru/post/1438921/


All Articles