Reputation: 23
I have a SSDT project in Visual Studio 2017 and multiple reports working off a shared data source. I can build all the reports and also preview them with the ability to refresh the data. However when I click deploy I receive the error message
Error : The given key was not present in the dictionary.
I have checked the project deployment details e.g (target sever details, Target Report Folder etc.) and they are all correct. Could anyone advise the best way to debug this error? Visual Studio Error Deployment Settings
Upvotes: 2
Views: 7330
Reputation: 1
I came across with the same issue. The problem was that I had no issues when I deploy my report and I tried to access it through URL, but when I tried to access programmatically the browser launch this error 'The given key was not present in the dictionary'.I investigated and found that I was not set up the visibility flag as 'false' on the code.
https://msdn.microsoft.com/en-us/library/microsoft.reporting.webforms.reportparameter.aspx
ReportParameter(String, String, Boolean)
Instantiates a new ReportParameter with a name, a value, and a visibility flag.
Finally, my code was something sort of this:
this.rptViewer.Reset();
rptViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
MyReportServerCredentials credencial = new MyReportServerCredentials();
rptViewer.ServerReport.ReportServerCredentials = credencial;
this.rptViewer.ServerReport.ReportServerUrl = new System.Uri(this.ReportServerUrl);
this.rptViewer.ServerReport.ReportPath = ReportUrl;
this.rptViewer.ServerReport.ReportServerUrl = new System.Uri(this.ReportServerUrl);
this.rptViewer.ServerReport.ReportPath = ReportUrl;
ReportParameter p1 = new ReportParameter("param1", new string[] { null }, false);
ReportParameter p2 = new ReportParameter("param2", new string[] { null }, false);
ReportParameter p3 = new ReportParameter("param3", new string[] { null }, false);
ReportParameter p4 = new ReportParameter("param4", new string[] { null }, false);
this.rptViewer.ServerReport.SetParameters(new ReportParameter[] { p1, p2, p3, p4 });
this.rptViewer.AsyncRendering = false;
this.rptViewer.SizeToReportContent = true;
this.rptViewer.ServerReport.Refresh();
I hope it helps!
Upvotes: 0
Reputation: 59
Thanks for everyone's feedback. I found the bug and will release a fix with the next version of the Reporting Services VSIX.
Thanks, Matt
Upvotes: 1
Reputation: 26
I had exactly the same problem using Microsoft Reporting Services 1.17 installed from Extensions and Updates in VS2017 15.3.5. I debugged with Visual Studio and decompiled with JetBrains dotPeek which pointed to an error in Microsoft.ReportingServices.BuildProcess.dll. Connection properties were being looked up by URL in a dictionary. As far as I can see, this dictionary never gets populated. The solution was to uninstall the extension and install SSDT for Visual Studio 2017 (15.3.0 preview).
Upvotes: 1
Reputation: 171
There is an .rdl.data file in the report project directory next to your .rdl file. If you close Report Designer, delete that file, and try and preview again, hope this helps.
Upvotes: 0