Klaus Löffelmann

Hello,

I have to confess that I never did anything with reporting services, reports, or whatsoever.

For a rather huge database application (based on sql express) I thought it might be best to do the printing with local reports, which I planed to bind to the objects, I already used as data layer in my project.

I created a simple report (just a table, with two fields), bound the report to the ReportViewer-Control, set the bindingsource-properties in form load.

But the only thing I see is this error message

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

So: What *is* a report definition and how *do* I specify it
Are there any infos I can get somewhere, to learn more about the whole concept

Thanks,

Klaus



Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

Rajeev Karunakaran

Report definition is the RDL (or RDLC) file. You can specify it by setting reportViewer.LocalReport.ReportPath property to the path of the RDL file.

I'll post a "Hello World" type sample separately.




Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

Klaus Loffelmann

Thanks for the quick response!

But isn't this file supposed to get taken out of my dll's resource at runtime
Why isn't it enough to determine the report (and therefore the report file or the source of the report file ) via the task menu of the report viewer control in the forms designer




Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

Rajeev Karunakaran

The ReportViewer control can load the RDL file from the file system (if you set LocalReport.ReportPath property), it can load it from your dll's resource (if you set LocalReport.ReportEmbeddedResource property) or you can supply the RDL definition as a stream by calling LocalReport.LoadReportDefinition().

In Visual Studio IDE, if you add an .RDLC file by default it's Build Action is set to Embedded Resource. If you select the report in ReportViewer control's smart tags panel then the LocalReport.ReportEmbeddedResource property gets set. ReportViewer should be able to find the RDL without your having to do anything extra.




Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

Klaus Loffelmann

Does it probably has to do with the fact, that the report, the dialog containing the reportviewer and the datasource is hosted in a dll-assembly-project (and for that matters in a subfolder called "analysis" inside the project) of the whole solution (which consists of 13 assemblies, btw).

I also notice when a change the build action from "embbeded resource" to "Content/Copy Allways", the report file is not copied to the solution's target output directory. It's only copied to that assemblies' output directory (and there it stays in a sub folder called analysis).

Could a workaround be to create a post build action which than copies the reportfiles to the target output directory of the whole solution (or copy the files manually there)

So - it's not working, one way or the other. Should I open a bug in the pfc
Do you have any other workarounds for that problem - I'm really stuck, here.

Thanks a lot,

Klaus





Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

Rajeev Karunakaran

If the report is an embedded resource in a separate assembly then ReportViewer may not be able to find it. You can load the resource yourself and call the reportViewer.LocalReport.LoadReportDefinition() method to supply the RDL to ReportViewer as a stream. You can also load the RDL from the file system by adding a build action to copy the RDL to the same folder as the .exe and then setting the LocalReport.ReportPath to the name of the RDL file.




Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

pg53

Hi
I am getting the same error message with a local, embedded report - my code:

Sub DoReportA(ByVal d1 As Date, ByVal d2 As Date, ByVal a As String)

Me.tblWRTableAdapter.FillBy(Me.dsReport1.tblWR, d1, d2, a)

Me.rv1.LocalReport.ReportEmbeddedResource = "report1.rdlc"

Me.rv1.RefreshReport()

Me.ShowDialog()

End Sub

What am I missing
Gotta say the new reports stuff is just great (apart from this and a couple of other minor probs!)
Thanks





Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

pg53

OK Found the problem, or rather two problems.
1The rdlc has to be qualified by the application name
2It's case-sensitive!




Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

bobchauvin


I'm having a similar error. I get "The report definition for report 'xxx' has not been specified.
Object Reference not set to an instance of an Object"

Here's my code:

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()







Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

sbrian26

I'd be willing to bet that the embedded resource could not be found due to not prefixing the application root namespace to the report definition for the embedded resource. e.g. if your root namespace is WindowsApplication1 and your embedded resource is report.rdl then the report definition should be specified as WindowsApplication1.report.rdl if you only specified report.rdl the report viewer will not find the embedded resource.



Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

rzr

The answer isnt really to hard:

reportViewer1.LocalReport.ReportEmbeddedResource = "<application namespace>.[optional <folder>].<filename.rdlc>"






Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

RAGolko123

I've got a winforms project with a Reports subdirectory off the project root.

I've got several report definition files there.

Using the Report Viewer control, I can select the correct report and it all works fine.

But following the Microsoft tutorial on how to print without previewing a report, I had to enter the ReportPath.

I've tried several different ways of entering that path, but the program always causes an exception because it says "The report definition for report 'xxx' has not been specified"

I've tried:

LocalReport report = new LocalReport();

report.ReportPath = @"Golko_CashBooks.Reports.rptCashBookCover.rdlc";

I've tried

report.ReportPath = @"Golko_CashBooks\Reports\rptCashBookCover.rdlc";

I've tried

report.ReportPath = @"Reports\rptCashBookCover.rdlc";

I've even tried the full path from "D:\etc.\Reports\rptCashBookCover.rdlc@

But it can never find the darn report!

I checked the report properties and it says "Compile" which is fine.

What is the secret to making this work

As I said I can view the report in report viewer, but I also want to be able to just print the report without viewing it with another button.

Thanks in advance






Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

rzr

Isnt your report embedded Quote:

reportViewer1.LocalReport.ReportEmbeddedResource = "<application namespace>.[optional <folder>].<filename.rdlc>





Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

ElG

Hello,

I migrated my web project from ASP.NET 1.1 to ASP.NET 2.0 using Visual Studio 2005. There are two conversion models: Web App and Web Site.

I converted my web project to Web App. Then I added a simple local report (just a table, with two fields), bound the report to the ReportViewer-Control, and added reference to Microsoft.ReportViewer.WebForms.

But the only thing I see when I run this app is the error message "The report definition for report Ą­ has not been specified."

I tested the same simple code with Web site - works fine.

Any ideas how to make ReportViewer working in Web App

Thanks!





Re: Visual Studio Report Controls The report definition for report 'xxx' has not been specified

Kinetic Media

EIG,

I'm having the exact same problem. It works in Web Site but does not work with the new Web App type application.

I've spent a whole day on this already :(

Please help...

ScAndal