none
The report definition for report 'RptXXX' has not been specified. RRS feed

  • Question

  • I am trying to build a report viewer in an ASP.net page.  I am using Reportviewer 11.0.0.0 in a VS 2010 project in VS 2012.

    I did the following:

    1. I copied an RDL file from and SSRS report into the project with the extension changed to rdlc. 
    2. I created a datatable in a dataset file using the SQL used in the original SSRS report.
    3. I opened the report in the report designer and changed the datasource and the dataset to those created in the project in step 2
    4. After several hours, I was finally able to get the report viewer's smarttag to open and  I was able to set the report in the smarttag.  The report has the reference to the dataset saved in it.  So I guess that is why the "Choose Datasource" box showed up empty.  As did the datasource instances. 

    However, the first run of the report gave me an error reporting:

    A data source instance has not been supplied for the data source

    So I tried to do it in the page_load by doing the below.

    this.rvCodCost.ProcessingMode = ProcessingMode.Local;
                this.rvCodCost.LocalReport.ReportPath = "Reports/DodIC_Expiration_Report.rdlc";
                ReportDataSource rds = new ReportDataSource("ReportDataSet", ReportDataSet.DataTable1DataTable);
                this.rvCodCost.LocalReport.DataSources.Add(rds);

    However this resulted in the error:

    The call is ambiguous between the following methods or properties: 'Microsoft.Reporting.WebForms.ReportDataSource.ReportDataSource(string, System.Collections.IEnumerable)' and 'Microsoft.Reporting.WebForms.ReportDataSource.ReportDataSource(string, System.Data.DataTable)'

    So I commented out this code and I tried clicking "rebind datasource" several times then running the app.  I now got the error,

    "The report definition for report 'RptXXX' has not been specified."

    It seems like this should be so simple yet I've been working on this one 8 line web page all day and have still not been able to show a report in the report viewer.

    I have view a lot of information on the web but most everyone says to fix this issue, put it in the code which throws the error above.

    I have not seen anyone address the issue of the empty datasource box in the choose datasource or explain why you set the datasource in the report if it is not used.


    Edward R. Joell MCSD MCDBA

    Friday, August 9, 2013 8:45 PM

Answers

  • It gets stranger. I took the report we created during the MS trouble call which displayed just fine, and added a dataset and some parameters.

    Bam!!! HTTPhandler error! I took out the parameters and every thing displayed just fine except that there were no results because no parameter was applied. There is an issue with how the parameters are being read.

    AND it had nothing to do with the version of the schema!!! I used the 2010/01 schema it it behaved the same way!!! No parameters, view is fine, but no data. Add parameters HTTPHander error.

    Update:

    On this page http://www.gotreportviewer.com/ in the FAQs it says about parameters in reportviewer

    Q: Why doesn't the ReportViewer control support parameter prompting in local mode? A: The ReportViewer control does not prompt for parameters when in local mode. It prompts for parameters when it is connected to a Report Server.

    In local mode it does not make sense for ReportViewer to prompt for parameters. The rationale is as follows: The most common use of report parameters is to pass to queries as values of query parameters. But unlike the Report Server, the ReportViewer control does not execute queries itself. Rather, queries are executed by the host application, and the result is passed to the ReportViewer control. So the ReportViewer control does not have the opportunity to set query parameters. Applications should take advantage of the parameterization features of Visual Studio data wizards instead.

    So I built a report with no parameters. I built a dropdown in the report viewer page to provide a parameter for the query. I used a data adapter to assign a data table to the dataset, and assigned parameter to the command setting the value equal to the selected value of the dropdown. I opened the report and got my results. This was in a report converted from an rdl to an rdlc. I had to go into the xml and remove the query parameters and the query SQL, under the datasources element.


    Edward R. Joell MCSD MCDBA



    • Marked as answer by joeller Wednesday, September 4, 2013 6:01 PM
    • Edited by joeller Wednesday, September 4, 2013 6:10 PM
    Wednesday, September 4, 2013 1:51 PM

All replies

  • Since the proper forum did not elicit any responses, I will try posting the above to an incorrect forum.

    Edward R. Joell MCSD MCDBA

    Monday, August 12, 2013 2:27 PM
  • I removed the "<localReport> tags from the rvCog_Cost control and I uncommented and modified my code in the Page_Load to the below;

                this.rvCodCost.ProcessingMode = ProcessingMode.Local;
                this.rvCodCost.LocalReport.ReportPath = "Reports/DodIC_Expiration_Report.rdlc";
                DataSet dsFile = new DataSet();
                dsFile = new ReportDataSet();
                DataTable dtFile = dsFile.Tables[0];
                ReportDataSource rds = new ReportDataSource(dtFile.TableName,dtFile);
                this.rvCodCost.LocalReport.DataSources.Add(rds);

    The error message return upon building and running in debug is

    A data source instance has not been supplied for the data source 'DataSet1'.

    (Dataset1 is the name of the Dataset of the report)


    Edward R. Joell MCSD MCDBA

    • Edited by joeller Monday, August 12, 2013 8:11 PM
    Monday, August 12, 2013 8:11 PM
  • I changed the code to the  below and it returned the same exact error message:
                this.rvCodCost.ProcessingMode = ProcessingMode.Local;
                this.rvCodCost.LocalReport.ReportEmbeddedResource = "TestWebReport.Reports.DoDIC_Expiration_Report.rdlc";
                //this.rvCodCost.LocalReport.ReportPath = "Reports/DodIC_Expiration_Report.rdlc";
                DataSet dsFile = new DataSet();
                dsFile = new ReportDataSet();
                DataTable dtFile = dsFile.Tables[0];
                ReportDataSource rds = new ReportDataSource(); //dtFile.TableName,dtFile);
                rds.Name = "TestReportDataSource";
                rds.Value = dsFile.Tables[0];
                this.rvCodCost.LocalReport.DataSources.Clear();
                this.rvCodCost.LocalReport.DataSources.Add(rds);
                this.rvCodCost.LocalReport.Refresh();
                


    Edward R. Joell MCSD MCDBA

    Tuesday, August 13, 2013 5:36 PM
  • I changed the code again to set the RDS.Name = "DataSet1";

                rds.Name = "Dataset1";
                rds.Value = (DataTable)dsFile.Tables[0];

    This resulted in page loading with no error messages in the report viewer.  But nothing else on the page showing up either.

    Update:

    I viewed the view source of the page.  This revealed the following hidden error message.

    <h2>Report Viewer Configuration Error</h2>
    <p>The Report Viewer Web Control HTTP Handler has not been 
    registered in the application's web.config file. Add &lt;add verb="*" 
    path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, 
    Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /&gt; 
    to the system.web/httpHandlers section of the web.config file, or 
    add &lt;add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" 
    path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, 
    Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /&gt; 
    to the system.webServer/handlers section for Internet Information Services 7 or later.</p>

    This statement is complete untrue.  Both references are in their proper place in the web.config.

    Edward R. Joell MCSD MCDBA


    • Edited by joeller Tuesday, August 13, 2013 9:32 PM New Information
    Tuesday, August 13, 2013 8:56 PM
  • In less than 20 hours I have to report to our development group on whether the Microsoft Report Viewer can be used to replace a third party control.  Based on my experience so far, I would have to report "No.  It is not possible to get the thing to work properly." 

    Edward R. Joell MCSD MCDBA

    Wednesday, August 14, 2013 4:33 PM
  • ReportViewer works OK if you don't stress it (which I am trying to do BTW).  VS 2012 obviously wants to work with RV 2012, no matter what your solution version is.  If you D&D an RV control onto a web form you'll get the rev 11 (aka RV 2012) references.  It will stick them in your web.config even if you have the 10 references in there causing other problems.  If you can deploy the RV 2012 runtime, then I suggest you stick to that.  If you have people that are using 2010 to develop on your project, then stick with the rev 10 references (VS 2012 won't be able to render the RV control in the design window - something I would like to fix).

    As far as getting the data source straightened out, you have to have something like the below in your markup.  I use ObjectDataSource.

    <LocalReport .....>

        <DataSources>

           <rsweb:ReportDataSource DataSourceId="MyObjectDataSourceId" Name="DataSet1" />

        </DataSources>

    </LocalReport>

    The ReportDataSource thing associates your markup object data source with the data set thing in the rdlc file.  They have to match.

    I haven't tried in in code because the markup thing seems to work fine.  If your "new ReportDataSet" thing didn't work, I suspect its because you passed it the wrong thing.  However, I haven't messed with it.

    B.

    Friday, August 16, 2013 11:03 AM
  • The ReportDataSource thing associates your markup object data source with the data set thing in the rdlc file. They have to match.

    Yes we discovered that back on the 13th.

    I tried setting creating an object datasource control and designating that as the datasource in the

    code as it still did not show up in the choose datasource window of the smarttag.

    I still had to show dataset1 as the rds name and the table[0] of the dataset in the object data source as the value.

    This still generated the same http handler error.


    Edward R. Joell MCSD MCDBA


    • Edited by joeller Monday, August 19, 2013 3:22 PM update
    Monday, August 19, 2013 2:05 PM
  • My meeting is in 45 minutes and as off now I will have to report that the organization's expert in SSRS could not get the report viewer to work.

    Update: The decision of the customer is to continue to investigate the usage of the report viewer while investigating building the report in html. So If anyone has anyideas about this invisible httphandler error I would like to hear them.


    Edward R. Joell MCSD MCDBA



    • Marked as answer by joeller Monday, August 19, 2013 6:22 PM
    • Unmarked as answer by joeller Tuesday, August 20, 2013 1:18 PM
    • Edited by joeller Tuesday, August 20, 2013 1:19 PM
    Monday, August 19, 2013 6:17 PM
  • I submitted an MS support ticket.  Working with the report we found that the error had nothing to do with the http handler.  It was due to the fact the schema used by the RDLCs that ReportViewer 11.0.0.0 could read were

    xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition"

    xmlns:rd=http://schemas.microsoft.com/SQLServer/reporting/reportdesigner

    But the schemas used by SSRS RDL

    xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"

    xmlns:cl="http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition"

    xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition"

    do not comply with the schemas required by RLDC for MS Reportviewer. The MS person stated that there was no possible means by which the XML in the RDL file could be manually modified to meet the requirements of the 2008/01/reportdefinition schema.

    I find it rather illogical that this should be the case.

    So I am going to attempt to find out how to modify the schema of the RDL to meet the criteria required by ReportViewer 11.0.0.0.


    Edward R. Joell MCSD MCDBA

    • Edited by joeller Friday, August 30, 2013 2:59 PM
    Friday, August 30, 2013 2:50 PM
  • It gets stranger. I took the report we created during the MS trouble call which displayed just fine, and added a dataset and some parameters.

    Bam!!! HTTPhandler error! I took out the parameters and every thing displayed just fine except that there were no results because no parameter was applied. There is an issue with how the parameters are being read.

    AND it had nothing to do with the version of the schema!!! I used the 2010/01 schema it it behaved the same way!!! No parameters, view is fine, but no data. Add parameters HTTPHander error.

    Update:

    On this page http://www.gotreportviewer.com/ in the FAQs it says about parameters in reportviewer

    Q: Why doesn't the ReportViewer control support parameter prompting in local mode? A: The ReportViewer control does not prompt for parameters when in local mode. It prompts for parameters when it is connected to a Report Server.

    In local mode it does not make sense for ReportViewer to prompt for parameters. The rationale is as follows: The most common use of report parameters is to pass to queries as values of query parameters. But unlike the Report Server, the ReportViewer control does not execute queries itself. Rather, queries are executed by the host application, and the result is passed to the ReportViewer control. So the ReportViewer control does not have the opportunity to set query parameters. Applications should take advantage of the parameterization features of Visual Studio data wizards instead.

    So I built a report with no parameters. I built a dropdown in the report viewer page to provide a parameter for the query. I used a data adapter to assign a data table to the dataset, and assigned parameter to the command setting the value equal to the selected value of the dropdown. I opened the report and got my results. This was in a report converted from an rdl to an rdlc. I had to go into the xml and remove the query parameters and the query SQL, under the datasources element.


    Edward R. Joell MCSD MCDBA



    • Marked as answer by joeller Wednesday, September 4, 2013 6:01 PM
    • Edited by joeller Wednesday, September 4, 2013 6:10 PM
    Wednesday, September 4, 2013 1:51 PM