Problem after update Reporting 7 to 15 in WPF

0 Answers 34 Views
.NET Framework
Jan
Top achievements
Rank 1
Jan asked on 07 Oct 2021, 12:57 PM | edited on 08 Oct 2021, 12:18 PM

After updating old version of Reporting to the newest we get an error:

An exception has occurred while processing 'TableContent' item:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Telerik.Reporting.Processing.Data.DataMember.<GetMembers>d__63.MoveNext()
   at Telerik.Reporting.Processing.GroupHierarchyWalker`1.WalkHierarchy(TGroup group, IDataMember parentData, Double distance, Int32 startIndex, Double& totalSize)
   at Telerik.Reporting.Processing.GroupHierarchyWalker`1.WalkHierarchy(IEnumerable`1 groups, IDataMember parentData, Int32 startIndex)
   at Telerik.Reporting.Processing.TableBuilder.Fill(IMultidimensionalDataSet resultSet)
   at Telerik.Reporting.Processing.Table.BindToData(IMultidimensionalDataSet result)
   at Telerik.Reporting.Processing.DataItem.ProcessItem()
   at Telerik.Reporting.Processing.Table.ProcessItem()
   at Telerik.Reporting.Processing.ReportItemBase.ProcessElement()
   at Telerik.Reporting.Processing.DataItem.ProcessElement()
   at Telerik.Reporting.Processing.ProcessingElement.Process(IDataMember dataContext)

 

This is happening when we add header to table

        protected void CreateSingleHeader(Unit columnWidth, string header, Table table)
        {
            Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
            tableGroupColumn.Name = "Header1";
            table.ColumnGroups.Add(tableGroupColumn);
            table.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(columnWidth));
            var textboxGroup = new Telerik.Reporting.HtmlTextBox();
            textboxGroup.Style.Padding.Left = Unit.Cm(0.1);
            textboxGroup.Style.VerticalAlign = VerticalAlign.Middle;
            textboxGroup.Style.Font.Size = Unit.Point(10);
            textboxGroup.Value = header;
            textboxGroup.Size = new SizeU(columnWidth, Unit.Cm(1));
            tableGroupColumn.ReportItem = textboxGroup;
        }


 

Please advise how to resolve this issue?

Neli
Telerik team
commented on 12 Oct 2021, 11:58 AM

Hi Jan,

I am sorry to hear that you are experiencing issues after the upgrade. In such cases when our clients want to upgrade from an older version, we advise following How to Upgrade an old project to the latest Telerik Reporting version KB article. The error is very generic and cannot say what exactly is the root of the issue. It will help me a lot if you provide us with more details about the scenario and why you need to create the header dynamically.

No answers yet. Maybe you can help?

Tags
.NET Framework
Asked by
Jan
Top achievements
Rank 1
Share this question
or