Tuesday, 15 May 2012
MR Report stuck in Report queue - startIndex cannot be larger than length of string
Management Report 2012
Trying to generate a report copied over from FRX 6.7 I experienced a problem. What was happening is that the report would sit there stuck with a status of queued. Looking in the event viewer application log on the server I saw the following error
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at Microsoft.Dynamics.Performance.Reporting.Engine.Common.Definition.Row.Load(XElement element)
at Microsoft.Dynamics.Performance.Reporting.Engine.Common.Definition.RowFormat.DeserializeRows(XElement xElement)
at Microsoft.Dynamics.Performance.Reporting.Engine.Common.Definition.RowFormat.Load(XElement element)
at Microsoft.Dynamics.Performance.Reporting.Engine.Common.ComponentKeyedCollection`2.Load(XElement element)
at Microsoft.Dynamics.Performance.Reporting.Engine.Common.Definition.Load(XElement element)
at Microsoft.Dynamics.Performance.Reporting.Scheduler.ReportRunner.RunReport(String reportDefinitionXml, Guid repositoryId, Guid generatedByPrincipalId, Guid reportFileId)
No idea so took a smaller sample of the report and this work. so I slowly added sections of the report until I found the problem.
The error was appearing due to two of the rows in the report contained a tree reference in the Related Formulas/Rows/Units but had no reference in the Link to Financial Dimensions column
Once I removed the tree reference and changed the rows to be DES type (so that the client could map the information at a later date), it then worked