'Index was outside the bounds of the array' exporting a report to Word in reporting services 2008 SP2
I have several reports that reference an external image that is a jpeg file stored in a folder on the report server. I can view the reports fine but when I attempt to export the report to Word I get the error 'Index was outside the bounds of the array.' The same reports can be exported fine when deployed to other servers. I have compared the configs of these servers and can find no differences. All servers are running SQL Server 2008 x64 SP2 The SSRS log file from the server where the problem occurs shows: library!ReportServer_0-2!1484!11/30/2010-15:02:24:: Call to GetPropertiesAction(/Project Management/Open Projects Test, PathBased). library!ReportServer_0-2!1484!11/30/2010-15:02:24:: Call to GetSystemPropertiesAction(). library!ReportServer_0-2!12d8!11/30/2010-15:02:25:: i INFO: RenderForNewSession('/Project Management/Open Projects Test') library!ReportServer_0-2!1338!11/30/2010-15:02:26:: Call to GetResourceContentsAction(/Resources/Logo.jpg). webserver!ReportServer_0-2!1338!11/30/2010-15:02:26:: i INFO: Processed resource '/Resources/Logo.jpg' webserver!ReportServer_0-2!12d8!11/30/2010-15:02:26:: i INFO: Processed report. Report='/Project Management/Open Projects Test', Stream='' library!ReportServer_0-2!1170!11/30/2010-15:02:31:: i INFO: RenderFromSession('/Project Management/Open Projects Test') reportrendering!ReportServer_0-2!1170!11/30/2010-15:02:32:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.HandledReportRenderingException: An error occurred during rendering of the report., ; Info: Microsoft.ReportingServices.ReportProcessing.HandledReportRenderingException: 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.WordRenderer.PictureDescriptor.InitImage(Byte[] aImgData, Byte[] aHash, Int32 imgIndex) at Microsoft.ReportingServices.Rendering.WordRenderer.PictureDescriptor.CreateDefaultEscherRecords(Byte[] imgData, Byte[] hash, Int32 imgIndex) --- End of inner exception stack trace --- at Microsoft.ReportingServices.Rendering.WordRenderer.PictureDescriptor.CreateDefaultEscherRecords(Byte[] imgData, Byte[] hash, Int32 imgIndex) at Microsoft.ReportingServices.Rendering.WordRenderer.PictureDescriptor..ctor(Byte[] imgData, Byte[] hash, Int32 aWidth, Int32 aHeight, Sizings sizing, Int32 imgIndex) at Microsoft.ReportingServices.Rendering.WordRenderer.Word97Writer.AddImage(Byte[] imgBuf, Single height, Single width, Sizings sizing) at Microsoft.ReportingServices.Rendering.WordRenderer.WordRenderer.RenderReportItem(RPLElement element, RPLMeasurement measurement, Int32 cellIndex, Single left, BorderContext borderContext, Boolean inTablix) at Microsoft.ReportingServices.Rendering.WordRenderer.WordRenderer.RenderRectangle(RPLContainer rectangle, Single left, Boolean canGrow, RPLMeasurement rectangleMeasurement, BorderContext parentBorderContext, Boolean inTablix, Boolean ignoreStyles) at Microsoft.ReportingServices.Rendering.WordRenderer.WordRenderer.Render() at Microsoft.ReportingServices.Rendering.WordRenderer.WordDocumentRenderer.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& someProps, CreateAndRegisterStream createAndRegisterStream) at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderFromOdpSnapshot(IRenderingExtension newRenderer, String streamName, ProcessingContext pc, RenderingContext rc, GetResource getResourceCallback) --- End of inner exception stack trace --- chunks!ReportServer_0-2!1170!11/30/2010-15:02:32:: w WARN: Rolling back shared chunk transaction for snapshot '30df82b1-898e-4fdd-a99f-d1f12c07b336', Permanent=False. library!ReportServer_0-2!1170!11/30/2010-15:02:32:: w WARN: Microsoft.ReportingServices.ReportProcessing.HandledReportRenderingException: 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. webserver!ReportServer_0-2!1170!11/30/2010-15:02:32:: e ERROR: Reporting Services error Microsoft.ReportingServices.Diagnostics.Utilities.RSException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.ReportProcessing.HandledReportRenderingException: 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. ui!ReportManager_0-1!15f8!11/30/2010-15:02:32:: Unhandled exception: System.Exception: An error occurred during rendering of the report. ---> System.Exception: An error occurred during rendering of the report. ---> System.Exception: Index was outside the bounds of the array. --- End of inner exception stack trace --- --- End of inner exception stack trace --- at Microsoft.Reporting.WebForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension) at Microsoft.Reporting.WebForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension) at Microsoft.Reporting.WebForms.ServerModeSession.RenderReport(String format, Boolean allowInternalRenderers, String deviceInfo, NameValueCollection additionalParams, Boolean cacheSecondaryStreamsForHtml, String& mimeType, String& fileExtension) at Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) The SSRS log file from the server that works shows: library!ReportServer_0-27!111c!11/30/2010-15:05:29:: Call to GetPropertiesAction(/Project Management/Open Projects Test, PathBased). library!ReportServer_0-27!111c!11/30/2010-15:05:29:: Call to ListEventsAction(). ui!ReportManager_0-28!3f0!11/30/2010-15:05:30:: i INFO: PageCountMode 'Estimate' read from config file library!ReportServer_0-27!111c!11/30/2010-15:05:32:: Call to GetSystemPropertiesAction(). library!ReportServer_0-27!3f0!11/30/2010-15:05:38:: i INFO: RenderForNewSession('/Project Management/Open Projects Test') library!ReportServer_0-27!3f0!11/30/2010-15:05:42:: Using folder D:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\RSTempFiles for temporary files. library!ReportServer_0-27!1494!11/30/2010-15:05:45:: Call to GetResourceContentsAction(/Resources/Logo.jpg). webserver!ReportServer_0-27!1494!11/30/2010-15:05:45:: i INFO: Processed resource '/Resources/Logo.jpg' webserver!ReportServer_0-27!3f0!11/30/2010-15:05:46:: i INFO: Processed report. Report='/Project Management/Open Projects Test', Stream='' library!ReportServer_0-27!3f0!11/30/2010-15:06:13:: i INFO: RenderFromSession('/Project Management/Open Projects Test') webserver!ReportServer_0-27!3f0!11/30/2010-15:06:15:: i INFO: Processed report. Report='/Project Management/Open Projects Test', Stream='' library!ReportServer_0-27!111c!11/30/2010-15:07:32:: i INFO: RenderFromSession('/Project Management/Open Projects Test') webserver!ReportServer_0-27!111c!11/30/2010-15:07:33:: i INFO: Processed report. Report='/Project Management/Open Projects Test', Stream='' library!ReportServer_0-27!12b8!11/30/2010-15:09:09:: i INFO: RenderFromSession('/Project Management/Open Projects Test') webserver!ReportServer_0-27!12b8!11/30/2010-15:09:10:: i INFO: Processed report. Report='/Project Management/Open Projects Test', Stream='' Note: I the log from the server that works it has the line 'Using folder D:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\RSTempFiles for temporary files.' any help would be greatly appreciated.
November 29th, 2010 11:16pm

Hi nstarr, From the error message, we can know the issue occurred while initiating image in a report. However, there are no any more detailed information. In order to troubleshoot the issue, could you please try to enable verberos log for the SQL Server Reporting Services. That is when the issue happens, we can more detailed information. Additionally, could you please try to check WindowsServiceUseFileShareStorage and WebServiceUseFileShareStorage to True to check if it solves the issue. For detailed steps to enable Verbose log, please see: http://msdn.microsoft.com/en-us/library/ms156500.aspx Thanks, Jin ChenJin Chen - MSFT
Free Windows Admin Tool Kit Click here and download it now
December 2nd, 2010 4:11am

Thanks for your reply Jin, I set WindowsServiceUseFileShareStorage and WebServiceUseFileShareStorage to True as you suggested and this made no difference. I turned on verbose logging and reviewed the log. This gave me the idea that the image itself might be the problem. I opened the image in GIMP, re-saved it as a jpeg and uploaded it over the top of the existing image. This fixed the problem. I don't know what the problem with the image was but it's now working so I'm not concerned.
December 2nd, 2010 6:05pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics