TableNumberField.HideResult throwing error

Hello, 

I am using the following code and it is throwing a system.indexOutOfRange error. 

Can you please advise on why this is happening and if there is a fix? 

 

var tableNumberField = paragraph.AppendField("Table", FieldType.FieldSequence) as WSeqField;

 tableNumberField.HideResult = true;


Thanks,

Natalie


5 Replies

SR Sindhu Ramesh Syncfusion Team January 28, 2025 05:04 PM UTC

Hi Natalie,
We tried to reproduce the reported issue “IndexOutOfBoundException while appending sequence field”, but it is working properly on our end. Kindly refer to the attached sample which we used on our side. To replicate the issue, kindly modify the sample as issue reproducible. Additionally, please share the stack trace details related to the issue.

Regards,
Sindhu Ramesh.


Attachment: CreateWorddocument_d4f9e6fa.zip


NW Natalie Westphal January 28, 2025 06:13 PM UTC

In the attached video, I opened up the project solution from the zip file above and recreated the issue. Please let me know if you can reproduce and how to solve the issue. 


Attachment: index_out_of_range_exception_7e619c4e.zip


SR Sindhu Ramesh Syncfusion Team January 29, 2025 02:53 PM UTC

Natalie,
We have reproduced the reported problem “IndexOutOfBoundException while setting HideResult in Sequence field” in our end. We will validate this issue and update you with more details within two days.

Regards,
Sindhu Ramesh.



SR Sindhu Ramesh Syncfusion Team January 31, 2025 02:41 PM UTC

Natalie,
We have confirmed that the reported issue with "IndexOutOfBoundException throws while enabling HideResult API after append sequence field” is a defect and we have logged a defect report. We will include the fix for this defect in our weekly NuGet release, which is estimated to be available on second week of February 2025.

The status of this bug can be tracked through the below link:
IndexOutOfBoundException thows while enabling HideResult API after append sequence field in WPF | Feedback Portal

Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.



SR Sindhu Ramesh Syncfusion Team February 11, 2025 11:29 AM UTC

Natalie,
As promised earlier, we have included the fix for the reported issue with “IndexOutOfBoundException throws while enabling HideResult API after append sequence field" in our latest weekly NuGet release (v28.2.5).

Root cause of the issue:
The issue occurs because the code tries to access the third element in the field code without checking its existence, causing an IndexOutOfRangeException.

Please use the below link to download our latest weekly NuGet:
Syncfusion.DocIO.Wpf

The status of this bug can be tracked through the below link:
IndexOutOfBoundException thows while enabling HideResult API after append sequence field in WPF | Feedback Portal

Note: We will include this fix in our 2025 Volume 1 Main release, which will be available at the end of March 2025.


Loader.
Up arrow icon