The error indicates an issue rendering the footer. Specifically while trying to render the footer it failed because when it tried to get the footer text it used an invalid length. My guess is that GetUsablePortionOfHeaderFooterString
is attempting to parse the footer string and it is failing because of the value. I would start by setting your footer to empty and see if the issue goes away. If it does then take a closer look at the footer expression you're using.
'An error occurred during local report processing.' - SSRS Excel Rendering throws error
ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
StackTrace "at
System.Text.StringBuilder.ToString(Int32 startIndex, Int32 length)\r\n
at Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.OpenXmlGenerator.GetUsablePortionOfHeaderFooterString(String candidate, Int32& spaceRemaining)\r\n
at Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.OpenXmlGenerator.AddFooter(String left, String center, String right)\r\n
at Microsoft.ReportingServices.Rendering.ExcelRenderer.Layout.LayoutEngine.RenderPageToExcel(IExcelGenerator excel, String key, Dictionary2 sharedBorderCache, Dictionary
2 sharedImageCache)\r\n
at Microsoft.ReportingServices.Rendering.ExcelRenderer.MainEngine.RenderRPLPage(RPLReport report, Boolean headerInBody, Boolean suppressOutlines)\r\n
at Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)" string
I have several report with export type excel. One particular report is throwing this error when I try to export.Other reports are working fine
How to resolve this issue? Thanks in advance
SQL Server Reporting Services
Developer technologies | C#
2 answers
Sort by: Most helpful
-
Michael Taylor 60,161 Reputation points
2022-12-16T22:44:03.477+00:00 -
Anonymous
2022-12-19T02:09:18.353+00:00 Hi @Mukil Vendhan
From what I've searched, it's possible that this is an issue with the number of characters in the string in the footer. Have you added expressions or text boxes to the footer? If there is, please delete it to check whether it is causing the error. If it's causing the error, try modifying it.
For more details, you can refer to this link: exporting-into-excel-issue-in-2012-ssrs-length-cannot-be-less-than-zero.
Best regards,
Aniya