This is a migrated thread and some comments may be shown as answers.

Internal Server Error: Value cannot be null. Parameter name: key

9 Answers 1902 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rased
Top achievements
Rank 1
Rased asked on 03 Apr 2015, 10:16 AM
Hi,

I am trying to load a simple report in a asp.net mvc web application using TypeReportSource.
But it shows "Internal Server Error: Value cannot be null. Parameter name: key" while making request to the following url

http://localhost:47829/api/reportsApi/clients/154917-9738/instances/154821-14b1/documents/154821-7d50154821-9a39/info

The response:

{"message":"","exceptionMessage":"Value cannot be null.\r\nParameter name: key","exceptionType":"Telerik.Reporting.Services.Engine.DocumentRenderException","stackTrace":"   at Telerik.Reporting.Services.Engine.Document.GetDocumentInfo()\r\n   at Telerik.Reporting.Services.Engine.ReportEngine.GetDocumentInfo(String clientID, String instanceID, String documentID)\r\n   at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetDocumentInfo(String clientID, String instanceID, String documentID)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()"}

how to resolve this error? same report is working perfectly with wpf application.

Telerik Reporting version Q1 2015 SP1.

Thanks

9 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 06 Apr 2015, 12:47 PM
Hello Rased,

Please check the samples in the TypeReportSource Class page and make sure that you are configuring the report source properly. In case the issue persists we will need to review a runnable sample project exhibiting the issue. You can also post the code used in the report viewer view and the reports controller, which might give us some insight on the issue.

Regards,
Nasko
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Rased
Top achievements
Rank 1
answered on 07 Apr 2015, 04:03 AM

Hello Nasko,

Downgrading from Q1 2015 SP1 to Q1 2015 solved the problem. There was a parameter type mismatch. Version Q1 2015 SP1 is unable to detect the problem but Q1 2015 does(instead of throwing Internal Server Error).

 

Thanks

0
Max
Top achievements
Rank 1
answered on 29 Apr 2015, 07:49 PM

Hi,

I got the same error message when trying to load reports in my MVC app, after upgrading from "Reporting Q2 2014" to "Reporting Q1 2015 SP1". I got the same message, exception type (Telerik.Reporting.Services.Engine.DocumentRenderException), and stacktrace posted by Rased.

Additionaly, I have found in output window on Visual Studio this exception:

*** RenderReport #0 STARTED ***
An error has occurred while rendering the report: System.ArgumentNullException: Valor não pode ser nulo.
Nome do parâmetro: key
   em System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   em System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   em Telerik.Reporting.Html5Rendering.Writers.Html.ImageWriter.WritePredefinedImage(IImageContainer imageContainer)
   em Telerik.Reporting.Html5Rendering.RenderingContext.WritePredefinedImage(IImageContainer imageContainer)
   em Telerik.Reporting.Html5Rendering.Writers.Html.PictureBox.Begin(LayoutElement element, ElementPageInfo info)
   em Telerik.Reporting.Html5Rendering.Writers.Report.WriteStartElement(LayoutElement element, ElementPageInfo pageInfo)
   em Telerik.Reporting.BaseRendering.PageHandler.Telerik.Reporting.Paging.IPageHandler.StartElement(LayoutElement element, ElementPageInfo info)
   em Telerik.Reporting.Paging.PageStartElement.AddToPage(IPageHandler handler)
   em Telerik.Reporting.Paging.PageElementLayer.AddToPage(IPageHandler handler)
   em Telerik.Reporting.Paging.PageElementManager.AddToPage(IPageHandler handler)
   em Telerik.Reporting.Paging.PageCompositionBase.AddElementsToPage()
   em Telerik.Reporting.Paging.PageCompositionBase.SendPhysicalPages()
   em Telerik.Reporting.Paging.PageCompositionBase.OutputPage()
   em Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
   em Telerik.Reporting.Paging.PagerBase.Telerik.Reporting.Paging.IPager.CreatePages(IPageHandler handler, Report report)
   em Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)

 

Then, I realised that the error was occurring on a image rendering in the report.

In this report I have a Telerik.Reporting.PictureBox; the "Value" property of this picturebox points to a System.Drawing.Image property from the report DataSource; and this exception ocurs when this Image property is null.

I left this image property null when I want to show no image on report, and this was working in Q2 2014, so I guess this is a bug in Telerik image rendering implementation on Q1 2015 SP1.

0
Nasko
Telerik team
answered on 30 Apr 2015, 07:56 AM
Hello Max,

You are correct about the issue in the Q1 2015 SP1 version of Telerik Reporting. The described behavior is a known issue in Q1 2015 SP1 which is exhibited when you use a PictureBox item with an expression which cannot be evaluated to a valid image, or is without a value/has a null value.

The issue has been fixed in the latest available Telerik Reporting internal build - 9.0.15.422 (download link). Please download and install the internal build to resolve the issue.

Regards,
Nasko
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Max
Top achievements
Rank 1
answered on 30 Apr 2015, 12:19 PM
Ok Nasko, thanks!!!
0
Olivier
Top achievements
Rank 2
answered on 14 May 2015, 08:29 PM

Hello Nacho

Your upgrade works !

 Please can you ask on your crew, cause it's the top ten for each control telerik,

To accept null or empty value in the variable or property. (treeview, dropdown ....)

StringIsEmptyOrNull on the paperboard, cause i search several day, it's cost me a lot.

 

thanks For your help.

0
Nasko
Telerik team
answered on 19 May 2015, 10:30 AM
Hello Olivier,

Regarding the Telerik Reporting Report Parameters you can enable null and empty values by setting the AllowNull and AllowBlank properties of the parameter to â€‹â€‹True​.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Olivier
Top achievements
Rank 2
answered on 19 May 2015, 12:32 PM

Hello Nasko,

Thanks , i know it.

It was a about the bug , in several case (control), the telerik's team don't take serious, about null value and empty value.

i say all time, but nobody want to understand , for example treewiew, the root node, can be null value or Zero value for the parent id.

it' was my private joke ! cause i m fighting to understand waht my report don't want work normaly.

 

Sorry if i borrow you.

Olivier,

 

 

0
Doug
Top achievements
Rank 2
answered on 24 Jun 2015, 05:40 PM
Just to throw my 2 cents in, I had a similar problem with a report that I had put together and then came across this post.   I am using 9.0.15.324.    The information in this thread led me to the following:  I had 4 picture boxes on my report where I had set the background image of the picture box to the picture i wanted.  The reportviewer threw the "Value cannot be null: Parameter name: key" error.  The report would still print, however with the correct image in the picture box (set as the background).  Subsequently I went back and realized that I really wanted to set the value of the picture box with my image instead of the backgroundimage property.  After making that fix, the problem went away.
Tags
General Discussions
Asked by
Rased
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Rased
Top achievements
Rank 1
Max
Top achievements
Rank 1
Olivier
Top achievements
Rank 2
Doug
Top achievements
Rank 2
Share this question
or