I am trying to get reporting in C# to work. I'm trying to embed my rdlc file as such:
var reportDataSource = new ReportDataSource("ProspectsDataSet", _allProspects);
ReportViewer.LocalReport.DataSources.Add(reportDataSource);
ReportViewer.LocalReport.ReportEmbeddedResource = "SdcDatabase.Modules.EnquiryModule.View.Reports.ProspectsReport.rdlc";
ReportViewer.ZoomMode = ZoomMode.PageWidth;
ReportViewer.RefreshReport();
The build action on the rdlc file itself is set to embedded resource and the copy to output directory set to copy always.
I have double checked and I'm certain that that is the correct namespace in the ReportEmbeddedResource string. However when I try to load the report I get this error:
An error occurred during local report processing. The definition of the report " is invalid.
An unexpected error occurred in Report Processing. The type initializer for 'Microsoft
.ReportingServices.ReportIntermiedateFormat.Persistence.IntermediateFormatVersion' threw an exception.
The path is not of a legal form.
What I have tried:
I have tried switching a few things around in the path, such as replacing '.' with '/' and '\' but so far I have not been able to get anything to fix this. I have also tried using LocalPath instead of EmbeddedResource but again I come across errors.
I have searched for this issue but haven't found anything to resolve my issue thus far.