Local Report in Winforms returns the followin error "The report definition for report 'xxx' has not been specified.Object Re

"The report definition for report 'xxx' has not been specified.
Object Reference not set to an instance of an Object"

The report viewer was dropped onto a tabpage, the report was created, and using the smartags for the viewer the report was specified.  The datasource has also been set in the report designer.

The error occurs on the Refreshreport step.


             ' See the Activate event
            Dim aparm_report_parms(0) As Microsoft.Reporting.WinForms.ReportParameter
            Me.ReportViewer_Cleanup.Reset()
            Me.ReportViewer_Cleanup.LocalReport.ReportEmbeddedResource = "MJ_Outlook_EntContacts.Cleanup_Summary.rdlc"
            aparm_report_parms(0) = New Microsoft.Reporting.WinForms.ReportParameter("Contact_Book_ID", ls_Current_Contact_Book)
            Me.ReportViewer_Cleanup.LocalReport.SetParameters(aparm_report_parms)
            Me.ReportViewer_Cleanup.LocalReport.DataSources.Add(New ReportDataSource("MJ_Dataset_MJ_Cleanup_Stats", Me.MJ_Cleanup_StatsBindingSource))

            Me.ReportViewer_Cleanup.RefreshReport()




Answer this question

Local Report in Winforms returns the followin error "The report definition for report 'xxx' has not been specified.Object Re

  • Milo123

    I've tried a simple report, too, no data.  Still no luck...

    I had the items in a Reports dir.  Defined as embedded resources.  Is there a way to check for embedded resources in the output exe

    The error occurs both in debug or release mode.

    I've also tried to add the reports to the project's embedded resources list, similar to how I've added icons and bitmaps in the past.


    Any more ideas

  • BobP - BIM

    Neither of these are the report definition you are specifying.  You code has:

    MJ_Outlook_EntContacts.Cleanup_Summary.rdlc

    but your assembly only contains

    MJ_Outlook_EntContacts.Report1.rdlc
    MJ_Outlook_EntContacts.Sync_Start.rdlc

    Are you sure that Cleanup_Summary.rdlc is marked as buildaction = Embedded Resource

  • Richard Lennox

    Brian,
    Thanks for the follow-up.  The best thing to try is the code samples I posted via the Product Feedback Center.  Two projects with a simple report (no data).

    The Winform works, VSTO, not. The only difference is VSTO.

    If you can, please check out the issue and validate.
    http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx feedbackid=50543bcc-f651-4724-844e-0943092e6cb4




  • Arshadje

    You can use ildasm.exe to open your .exe and doubleclick on manifest. You should be able to see the names of the resources.  The name of the resource will be something like: namespace.folder.filename
  • SocratesBrighton

    The error message means ReportViewer could not find the .rdlc file. Are you using Beta 2 or a later build of VS Is the Build Action of the .rdlc file set to Embedded Resource Is the namespace of your app MJ_Outlook_EntContacts Is the case of the .rdlc filename as specified in code


  • eggie5

    Yes to all the questions.  I've read prior posts, and it seemed that everything was correct in code, and in the designer all the settings seemed correct as well.

    I'll try a more simple example report...



  • husman

    Rajeev,

    I do see the references in the .dll

    .mresource public MJ_Outlook_EntContacts.Report1.rdlc
    {
      // Offset: 0x00001E63 Length: 0x0000047E
    }
    .mresource public MJ_Outlook_EntContacts.Sync_Start.rdlc
    {
      // Offset: 0x000022E5 Length: 0x000050A8
    }

    No luck, though.


  • Dopey Coder

    Rajeev,

    I've created a test app that demonstrates that reports don't work in a VSTO app. 
    Try to download and test it out.  The app has a datasource, but even a report w/o data will fail to load.

    The attached zip contains two sample projects, one VSTO, one standard winform.  The Winform works, VSTO, not.
    The only difference is VSTO.

    http://us.f1.yahoofs.com/bc/3244135e_L4060b625/bc/VS2005B2/ReportTests.zip BCNaCLDBRJAJSXti

    I've also submitted it as a formal bug request, so if you can validate, go here and let them know so they'll give it more priority:
    http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx feedbackid=50543bcc-f651-4724-844e-0943092e6cb4


  • GoldenBrown

    Instead of that we used the property, ReportPath to assign the path of the report file (.rdlc) that has to be displayed. With this modification that application worked fine. So you need to provide the correct path of the report file (.rdlc) to get the application running.

     

    The following lines of code show the usage of the ReportPath property in TestForm1.Designer.vb file.

     

    'Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "TestOutlookAddin.TestReport1.rdlc"

    'Me.ReportViewer1.LocalReport.ReportPath = Nothing

    Me.ReportViewer1.LocalReport.ReportEmbeddedResource = Nothing

    Me.ReportViewer1.LocalReport.ReportPath = "C:\Documents and Settings\Administrator\Desktop\TestOutlookAddin\TestOutlookAddin\TestReport1.rdlc"

     

    This seems to be a bug in the VS.NET 2005 Beta 2 and VSTO 2.0 Beta 2; however it has been fixed in Visual Studio 2005 Team Suite Release Candidate, we tested the same functionality on Release Candidate and is working fine. Release Candidate is available for download to the MSDN Subscribers.



  • Local Report in Winforms returns the followin error "The report definition for report 'xxx' has not been specified.Object Re