Hi,
I`m using Html Report viewer (R2 2016) integrated in a web application.
I`m experiencing the following problem:
When the application is published (to test or production environment) sometimes the report viewer seems to fail rendering the reports (this does not happen on my Dev environment).
It does not happen all the time, it just happens sometimes.
When the problem occurs the viewer seems to send never ending requests to the Report API controller with the following signature:
~/api/reports/clients/085352-e708/instances/083615-c3d7/documents/085412-2b2a085412-5cbd/info which result with the following json response:
{
"documentReady":false,
"pageCount":0,
"documentMapAvailable":false,
"bookmarkNodes":null
}
No errors, no timeouts just this same json returned saying "documentReady":false.
Once this happens the only way to stop these requests is:
-Restart iis
-Refresh browser
-Delete report viewer cache directory.
If for example I click back button and open the report again, it may be rendered but the requests from the old report continue running.
I`m not sure if the caching behavior has something to do with this but we are using File storage cache with changed default cache directory from "C:\Windows\temp" to internal directory for the Reports web application that is hosted in IIS.
This is the ReportServiceConfiguration object:
new Telerik.Reporting.Services.ReportServiceConfiguration
{
HostAppId = ...,
ReportResolver = ...,
Storage = new FileStorage(HttpContext.Current.Server.MapPath("~/Reports")),
ReportSharingTimeout = 0,
ClientSessionTimeout = 15,
};
I`m attaching a screenshot demonstrating the requests from Google Chrome.
I spent some time investigating the problem with enabled system diagnostics trace listener for the Reporting API.
I observed the following in the log:
If the report is rendered successfully, then the log is just filled with some performance metrics information:
*** ReportProcessor.ProcessReport STARTED ***
*** ProcessReport #0 STARTED ***
*** ReportProcessor.ProcessReport STARTED ***
*** ProcessReport #0 STARTED ***
*** ProcessReport #0 DONE in 00:00:00.5807344 ***
*** ReportProcessor.ProcessReport DONE in 00:00:00.5903065 ***
...
If some error occurs for some reason (bad query, data conversion error, data source discovery/connection problems) it is indicated in the log and the report is rendered showing the error to the user, which is ok:
...
An exception has occurred while processing 'table1' item:
System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting date and/or time from character string.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
...
There are though other errors that occur (for unknown reasons) that don`t seem to stop report from being executed, resulting in endless requests that were previously described.
I managed to catch two of these errors without any explanation why and when they happen (the same report with the same input parameters sometimes fails and sometimes not):
1.
...
An error has occurred while rendering the report: System.Threading.ThreadAbortException: Thread was being aborted.
at Microsoft.Win32.Win32Native.CreateDirectory(String path, SECURITY_ATTRIBUTES lpSecurityAttributes)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at Telerik.Reporting.Cache.File.FileCache.Write(String key, Byte[] bytes)
at Telerik.Reporting.Cache.CacheStorage.SetBytes(String key, Byte[] value)
at Telerik.Reporting.Services.Engine.DocumentResources.AddResource(RenderingResource resource)
at Telerik.Reporting.Services.Engine.Document.AddResource(RenderingResource s)
at Telerik.Reporting.Services.Engine.RenderingStream.Finish()
at Telerik.Reporting.Html5Rendering.Writers.ContentOnlyPage.WritePageStyles(String css)
at Telerik.Reporting.Html5Rendering.Writers.PageBase.WriteEndPage()
at Telerik.Reporting.Paging.PageCompositionBase.SendPhysicalPages()
at Telerik.Reporting.Paging.PageCompositionBase.OutputPage()
at Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
*** RenderReport #0 DONE in 00:00:00.3681450 ***
2.
...
*** RenderReport #0 STARTED ***
An error has occurred while rendering the report: System.Threading.ThreadAbortException: Thread was being aborted.
at System.Delegate.DelegateConstruct(Object target, IntPtr slot)
at Telerik.Reporting.Processing.ElementTreeHelper.GetFirstDescendantsOfType[T](LayoutElement element)
at Telerik.Reporting.Paging.PagerBase.ResetBookmarkPages(ProcessingElement element)
at Telerik.Reporting.Paging.PagerBase.ResetBookmarkPages(ProcessingElement element)
at Telerik.Reporting.Paging.PagerBase.Telerik.Reporting.Paging.IPager.CreatePages(IPageHandler handler, Report report)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
*** RenderReport #0 DONE in 00:00:00.7007492 ***
An error has occurred while rendering the report: System.Threading.ThreadAbortException: Thread was being aborted.
at Telerik.Reporting.Html5Rendering.CssStyleBuilder.AddBackgroundDeclarations(LayoutElement element)
at Telerik.Reporting.Html5Rendering.CssStyleBuilder.AddCssStyleFromProcessingElement(LayoutElement element, ElementPageInfo pageInfo)
at Telerik.Reporting.Html5Rendering.Writers.Html.Element.Begin(LayoutElement element, ElementPageInfo pageInfo)
at Telerik.Reporting.Html5Rendering.Writers.Report.WriteStartElement(LayoutElement element, ElementPageInfo pageInfo)
at Telerik.Reporting.Paging.PageElementLayer.AddToPage(IPageHandler handler)
at Telerik.Reporting.Paging.PageElementManager.AddToPage(IPageHandler handler)
at Telerik.Reporting.Paging.PageCompositionBase.SendPhysicalPages()
at Telerik.Reporting.Paging.PageCompositionBase.OutputPage()
at Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
*** RenderReport #0 DONE in 00:00:00.7177329 ***
Is there any explanation of this behavior, how can I troubleshoot the reason behind it?
I`m using Html Report viewer (R2 2016) integrated in a web application.
I`m experiencing the following problem:
When the application is published (to test or production environment) sometimes the report viewer seems to fail rendering the reports (this does not happen on my Dev environment).
It does not happen all the time, it just happens sometimes.
When the problem occurs the viewer seems to send never ending requests to the Report API controller with the following signature:
~/api/reports/clients/085352-e708/instances/083615-c3d7/documents/085412-2b2a085412-5cbd/info which result with the following json response:
{
"documentReady":false,
"pageCount":0,
"documentMapAvailable":false,
"bookmarkNodes":null
}
No errors, no timeouts just this same json returned saying "documentReady":false.
Once this happens the only way to stop these requests is:
-Restart iis
-Refresh browser
-Delete report viewer cache directory.
If for example I click back button and open the report again, it may be rendered but the requests from the old report continue running.
I`m not sure if the caching behavior has something to do with this but we are using File storage cache with changed default cache directory from "C:\Windows\temp" to internal directory for the Reports web application that is hosted in IIS.
This is the ReportServiceConfiguration object:
new Telerik.Reporting.Services.ReportServiceConfiguration
{
HostAppId = ...,
ReportResolver = ...,
Storage = new FileStorage(HttpContext.Current.Server.MapPath("~/Reports")),
ReportSharingTimeout = 0,
ClientSessionTimeout = 15,
};
I`m attaching a screenshot demonstrating the requests from Google Chrome.
I spent some time investigating the problem with enabled system diagnostics trace listener for the Reporting API.
I observed the following in the log:
If the report is rendered successfully, then the log is just filled with some performance metrics information:
*** ReportProcessor.ProcessReport STARTED ***
*** ProcessReport #0 STARTED ***
*** ReportProcessor.ProcessReport STARTED ***
*** ProcessReport #0 STARTED ***
*** ProcessReport #0 DONE in 00:00:00.5807344 ***
*** ReportProcessor.ProcessReport DONE in 00:00:00.5903065 ***
...
If some error occurs for some reason (bad query, data conversion error, data source discovery/connection problems) it is indicated in the log and the report is rendered showing the error to the user, which is ok:
...
An exception has occurred while processing 'table1' item:
System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting date and/or time from character string.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
...
There are though other errors that occur (for unknown reasons) that don`t seem to stop report from being executed, resulting in endless requests that were previously described.
I managed to catch two of these errors without any explanation why and when they happen (the same report with the same input parameters sometimes fails and sometimes not):
1.
...
An error has occurred while rendering the report: System.Threading.ThreadAbortException: Thread was being aborted.
at Microsoft.Win32.Win32Native.CreateDirectory(String path, SECURITY_ATTRIBUTES lpSecurityAttributes)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at Telerik.Reporting.Cache.File.FileCache.Write(String key, Byte[] bytes)
at Telerik.Reporting.Cache.CacheStorage.SetBytes(String key, Byte[] value)
at Telerik.Reporting.Services.Engine.DocumentResources.AddResource(RenderingResource resource)
at Telerik.Reporting.Services.Engine.Document.AddResource(RenderingResource s)
at Telerik.Reporting.Services.Engine.RenderingStream.Finish()
at Telerik.Reporting.Html5Rendering.Writers.ContentOnlyPage.WritePageStyles(String css)
at Telerik.Reporting.Html5Rendering.Writers.PageBase.WriteEndPage()
at Telerik.Reporting.Paging.PageCompositionBase.SendPhysicalPages()
at Telerik.Reporting.Paging.PageCompositionBase.OutputPage()
at Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
*** RenderReport #0 DONE in 00:00:00.3681450 ***
2.
...
*** RenderReport #0 STARTED ***
An error has occurred while rendering the report: System.Threading.ThreadAbortException: Thread was being aborted.
at System.Delegate.DelegateConstruct(Object target, IntPtr slot)
at Telerik.Reporting.Processing.ElementTreeHelper.GetFirstDescendantsOfType[T](LayoutElement element)
at Telerik.Reporting.Paging.PagerBase.ResetBookmarkPages(ProcessingElement element)
at Telerik.Reporting.Paging.PagerBase.ResetBookmarkPages(ProcessingElement element)
at Telerik.Reporting.Paging.PagerBase.Telerik.Reporting.Paging.IPager.CreatePages(IPageHandler handler, Report report)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
*** RenderReport #0 DONE in 00:00:00.7007492 ***
An error has occurred while rendering the report: System.Threading.ThreadAbortException: Thread was being aborted.
at Telerik.Reporting.Html5Rendering.CssStyleBuilder.AddBackgroundDeclarations(LayoutElement element)
at Telerik.Reporting.Html5Rendering.CssStyleBuilder.AddCssStyleFromProcessingElement(LayoutElement element, ElementPageInfo pageInfo)
at Telerik.Reporting.Html5Rendering.Writers.Html.Element.Begin(LayoutElement element, ElementPageInfo pageInfo)
at Telerik.Reporting.Html5Rendering.Writers.Report.WriteStartElement(LayoutElement element, ElementPageInfo pageInfo)
at Telerik.Reporting.Paging.PageElementLayer.AddToPage(IPageHandler handler)
at Telerik.Reporting.Paging.PageElementManager.AddToPage(IPageHandler handler)
at Telerik.Reporting.Paging.PageCompositionBase.SendPhysicalPages()
at Telerik.Reporting.Paging.PageCompositionBase.OutputPage()
at Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
*** RenderReport #0 DONE in 00:00:00.7177329 ***
Is there any explanation of this behavior, how can I troubleshoot the reason behind it?