We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Starting in 2019, the Reporting control is no longer included in Essential Studio. If you're experiencing issues with the Syncfusion Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion and appreciate your understanding.

KeyNotFound in ProcessReport

I am trying to generate a report based on the samples but I keep getting the below exception 

Sf_Exception - System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Syncfusion.EJ.ReportViewer.Internal.ReportViewerInternalHelper.ProcessReport()

I am calling it like this in the view

<script type="text/javascript">
    $(function () {
                reportServiceUrl: "api/ReportApi",
                processingMode: ej.ReportViewer.ProcessingMode.Local,
                reportPath: "~/App_Data/Report1.rdlc"

and in the Web API controller I have this

        public object PostReportAction(Dictionary<string, object> jsonResult)
            return ReportHelper.ProcessReport(jsonResult, this);

        //Get action for getting resources from the report
        public object GetResource(string key, string resourcetype, bool isPrint)
            return ReportHelper.GetResource(key, resourcetype, isPrint);

        //Method will be called when initialize the report options before start processing the report        
        public void OnInitReportOptions(ReportViewerOptions reportOption)


        //Method will be called when reported is loaded
        public void OnReportLoaded(ReportViewerOptions reportOption)
            reportOption.ReportModel.ProcessingMode = ProcessingMode.Local;
            reportOption.ReportModel.ReportPath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data/Report1.rdlc");
            reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "Sales", Value = OrderReportModel.GetData() });

I have also set the license key in the Global.asax.

When I debug the program, I am succesful in reaching the PostReportAction method but it returns the above KeyNotFound exception.

Can you please tell me what Key is being used that I am missing?


1 Reply

MM Mageshyadav M Syncfusion Team March 21, 2019 08:58 AM UTC

Hi Neil, 
Thanks for your interest in our Syncfusion product. 
We were unable to reproduce the mentioned key not found issue when loading the RDLC report in report viewer. So we have prepared the simple sample to load the RDLC report in web report viewer. Could you please confirm whether the below attached sample is working or not at your end. 
If issue still persists then could you please revert the above sample with issue reproducible case to validate the mentioned problem at our end. 

Live Chat Icon For mobile
Up arrow icon