none
IndexOutOfRange Exception when Printing or viewing report in Print Layout with Header/Footer Expressions on SSRS 2008 SP3

    Question

  • We are using SSRS 2008 with SP3 applied. Our reports are using dynamic grouping and showing/hiding columns based on parameter values. We have a page number expression in the page footer, and an expression in the page header that creates a display string with the report parameter values. Without fail, if we run this report and select Print Layout, we get a rrRenderingError in the report viewer component.

    If we remove the page number expression from the page footer, and remove the header expression, the report works fine. Also, without changes, the report works without error in SSRS 2012. I've included some of the output from the ReportServer log file. Is there a fix for this problem, or some work around that does not include removing the header/footer expressions?

    library!ReportServer_0-4!1750!04/30/2013-10:50:35:: i INFO: RenderFromSession('/Open Purchase Orders')
    webserver!ReportServer_0-4!700!04/30/2013-10:50:35:: i INFO: Processed report. Report='/Open Purchase Orders', Stream=''
    reportrendering!ReportServer_0-4!1750!04/30/2013-10:50:36:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report., ;
     Info: Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at Microsoft.ReportingServices.Rendering.ImageRenderer.Renderer.ProcessTablixContainer(RPLTablix tablix, RectangleF position, Single[] rowStarts, Single[] columnStarts)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.Renderer.ProcessReportItem(RPLMeasurement measurement, RectangleF bounds, Boolean renderBorders, Boolean hasTablixCellParent)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.Renderer.ProcessNonTablixContainerReportItems(RPLContainer container, RectangleF bounds)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.Renderer.ProcessReportItem(RPLMeasurement measurement, RectangleF bounds, Boolean renderBorders, Boolean hasTablixCellParent)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.Renderer.ProcessPage(RPLReport rplReport, Int32 pageNumber, FontCache sharedFontCache, List`1 paragraphsItemizedData)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
       --- End of inner exception stack trace ---
       at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
       at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderFromOdpSnapshot(IRenderingExtension newRenderer, String streamName, ProcessingContext pc, RenderingContext rc, GetResource getResourceCallback)
       --- End of inner exception stack trace ---

    Tuesday, April 30, 2013 3:36 PM

All replies

  • I would say do more testing and find close error.

    First keep header and remove footer. And then run report if it works means you have don't have problem in header or its give error then remove all expression and just test with your Parameter value in header. if it works fine add your next requirements...and so on..

    Our goal is first find out the problem is in header or footer and then which expression.

    Then we have more idea like what is wrong. Also check all your report body margin with its size it not more then your report size.

    Tuesday, April 30, 2013 4:11 PM
  • Thanks for your response. I have tested either removing the page footer expression or page header expression. Removing only one or the other does not correct the problem. It is only when both expressions are removed that the report will render without error. The report body with margin is not greater than the report dimensions. I also get a 'The stream cannot be found. The stream identifier that is provided to an operation cannot be located in the report server database. (rsStreamNotFound)' error message in the windows forms report viewer.
    Tuesday, April 30, 2013 5:33 PM
  • Hello,

    Can you render the report in Preview mode? Based on the error message, the issue occurs when processing the report.

    Please post the expressions you used in the page header and page footer for further analysis.

    Regards
    Fanny Liu


    Fanny Liu
    TechNet Community Support

    Thursday, May 02, 2013 9:09 AM
  • Hi Rudy, You get this error message because some part of the report in your case Page header & footer are outside the limits of the page layout that you chose.

    For instance

    Portrait: 8.5in (Width) * 11in (Height)

    Please make sure including the margins, header & footer your report layout is confined between these dimensions.

    Thursday, May 02, 2013 11:17 PM
  • This has no affect on getting the error in Print Layout mode or not.
    Monday, May 06, 2013 2:59 PM
  • Preview mode works fine. It is only while printing, or rendering in Print Layout. it usually processes a few pages, then generates the error.

    The header expression is used to format a string used to summarize the report parameters selected. It is:

    ="As of " + FormatDateTime(Parameters!Date.Value, DateFormat.ShortDate)
    +
    iif(
    len(iif(IsNothing(Parameters!VendorId.Value),"","Vendor="+Parameters!VendorId.Label + "; ")+
    iif(IsNothing(Parameters!EmployeeId.Value),"","Employee="+Parameters!EmployeeId.Label + "; "))=0,"",
    "Filtered On: "+iif(IsNothing(Parameters!VendorId.Value),"","Vendor="+Parameters!VendorId.Label + "; ")+
    iif(IsNothing(Parameters!EmployeeId.Value),"","Employee="+Parameters!EmployeeId.Label + "; ")
    )+
    "   "+"Grouped By: "+
    iif(
    Len(iif(Parameters!GroupBy1.Value="GroupId","",Parameters!GroupBy1.Label+"; ")+
    iif(Parameters!GroupBy2.Value="GroupId","",Parameters!GroupBy2.Label+"; ")+
    iif(Parameters!GroupBy3.Value="GroupId","",Parameters!GroupBy3.Label+"; ")+
    iif(Parameters!GroupBy4.Value="GroupId","",Parameters!GroupBy4.Label+"; "))=0,
    "  None",
    iif(Parameters!GroupBy1.Value="GroupId","",Parameters!GroupBy1.Label+"; ")+
    iif(Parameters!GroupBy2.Value="GroupId","",Parameters!GroupBy2.Label+"; ")+
    iif(Parameters!GroupBy3.Value="GroupId","",Parameters!GroupBy3.Label+"; ")+
    iif(Parameters!GroupBy4.Value="GroupId","",Parameters!GroupBy4.Label+"; ")
    )+
    "  Types: "+iif(Parameters!ShowVendorInd.Value,"Vendor; ","")+
    iif(Parameters!ShowEmployeeInd.Value,"Employee; ","")

    The report footer has two expressions. One to display the execution time, and one for page numbers:

    =Globals!ExecutionTime

    ="Page "+FormatNumber(Globals!PageNumber,0) + " of " +FormatNumber(Globals!TotalPages,0)

    Monday, May 06, 2013 5:38 PM