SSRS Report breaking with an error "System.UriFormatException: Invalid URI: The Uri string is too long."

  • Need quick help on this issue.

    Environment Details:

    Reporting server migrated from 2005 to 2012.

    But we haven't migrated rdls and these reports are being viewed via reportviewer 8.0 version (2005).

    IIS 7.0 ( hosting environment has 8.0 & 11.0 dlls for report viewer)

    The reports are loading properly when limited values passed as parameter.

    When multiple parameters are passed (i.e. complete hierarchy tree selection), report is rendered as expected with 740 pages. But when user clicks on next page of report viewer control, we are getting "Invalid URI: URI is too long" error.

    As per suggestions on other blogs added settings to Report Server web.config. But it didn't worked for me.

    <add key="aspnet:IgnoreFormActionAttribute" value="true" />

    <add key="aspnet:MaxHttpCollectionKeys" value="100000" />

    Report Server Log Files Details:

    library!ReportServer_0-2!6e0!05/03/2013-00:44:35:: i INFO: Using folder C:\Program Files\Microsoft SQL Server\MSRS11.REPORTS\Reporting Services\RSTempFiles for temporary files.

    library!ReportServer_0-2!6e0!05/03/2013-00:44:41:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException:

    Internal error, Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException:

    An internal error occurred on the report server. See the error log for more details. --->

    System.UriFormatException: Invalid URI: The Uri string is too long.

    at System.Uri.EscapeString(String input, Int32 start, Int32 end, Char[] dest, Int32& destPos, Boolean isUriString, Char force1, Char force2, Char rsvd)

    at System.Uri.EscapeDataString(String stringToEscape)

    at Microsoft.ReportingServices.Common.UrlUtil.UrlEncode(String input)

    at Microsoft.ReportingServices.ReportProcessing.ParameterInfoCollection.UrlEncodeSingleParam(StringBuilder url, String name, Object val, Func`2 cs)

    at Microsoft.ReportingServices.ReportProcessing.ParameterInfoCollection.ToUrl(Boolean skipInternalParameters, Func`2 cs)

    at Microsoft.ReportingServices.Library.ReportExecutionBase.WriteParametersToJobContext(RunningJobContext jobContext)

    at Microsoft.ReportingServices.Library.ReportExecutionBase.Execute()

    at Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()

    --- End of inner exception stack trace ---;

    library!ReportServer_0-2!6e0!05/03/2013-00:44:43:: i INFO: Dump result: External dump process return code 0x20000001.

    External dump process returned no errors.

    .

    webserver!ReportServer_0-2!6e0!05/03/2013-00:44:43:: e ERROR: Reporting Services error Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details. ---> System.UriFormatException: Invalid URI: The Uri string is too long.

    at System.Uri.EscapeString(String input, Int32 start, Int32 end, Char[] dest, Int32& destPos, Boolean isUriString, Char force1, Char force2, Char rsvd)

    at System.Uri.EscapeDataString(String stringToEscape)

    at Microsoft.ReportingServices.Common.UrlUtil.UrlEncode(String input)

    at Microsoft.ReportingServices.ReportProcessing.ParameterInfoCollection.UrlEncodeSingleParam(StringBuilder url, String name, Object val, Func`2 cs)

    at Microsoft.ReportingServices.ReportProcessing.ParameterInfoCollection.ToUrl(Boolean skipInternalParameters, Func`2 cs)

    at Microsoft.ReportingServices.Library.ReportExecutionBase.WriteParametersToJobContext(RunningJobContext jobContext)

    at Microsoft.ReportingServices.Library.ReportExecutionBase.Execute()

    at Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()

    --- End of inner exception stack trace ---

    at Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()

    at Microsoft.ReportingServices.Library.ExecutionDisposerProxy.ExecuteReport()

    at Microsoft.ReportingServices.Library.RenderReportAction.PerformExecution()

    at Microsoft.ReportingServices.Library.RenderReportAction.Render()

    at Microsoft.ReportingServices.Library.StreamRequestHandler.RenderReport(SessionfulClientRequest sessionManager)

    at Microsoft.ReportingServices.WebServer.ReportServiceHttpHandler.RenderReport(SessionfulClientRequest sessionManager)

    at Microsoft.ReportingServices.Library.StreamRequestHandler.PerformStreamedOperation(StreamedOperation operation)

    at Microsoft.ReportingServices.Library.StreamRequestHandler.RenderItem(ItemType itemType)

    at Microsoft.ReportingServices.Library.StreamRequestHandler.ExecuteCommand()

    at Microsoft.ReportingServices.WebServer.ReportServiceHttpHandler.RenderPage()

    ==========================

    If you need any more inputs please reply me on nbethi@gmail.com

  • Do u get the same error when using Report manager?

    Do u get the error instantly or does the report try to render first?

    Does the same issue happen with fewer report parameters?

    Does the same issue happen with fewer report data?

    Check for timeout issues in IIS and Report server. Does this happen only for the single report or all reports?

    What kind of authentication are you using?

    Jayanth Kurup[/url]

  • Here is the response to the above questions.

    1. This issue doesn't show up from report manager. I captured all the parameters via debug and ran the report with full parameters and able to get report rendered without any issues. Also able to navigate the next pages.

    2. Report will render first with proper pagination. This issue occurs instantly when I click on next page "arrow Symbol" or (+/-) toggle button with in report. But I'm able to export the content to Excel or PDF.

    3. With fewer parameters it will render properly & also allows me to navigate between pages(900 Page count).

    4. Using Forms Authentication.

    5. This issue appears for all reports with full parameters passed from application (where reports are rendered inside report viewer).

    I'm not sure, but do you could this be problem with ReportViewer(8.0) control?

  • Finally we got the issue resolved. It was problem with parameter lenght that being passed to

    report. We got this resolved by decreasing the parameter length in our code.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply