DocX icon indicating copy to clipboard operation
DocX copied to clipboard

Row.ReplaceText not working in Header Tables

Open DominicJL opened this issue 6 years ago • 3 comments

Row.ReplaceText behaves differently for tables in the Header than to tables in the body.

Example: A table with a single row containing the text "foo" is in the header. An exact copy of this table is in the body.

For the body table, we select the first row and insert it into the table as a new row (table.InsertRow). Then we use the row.ReplaceText method to change the text on the new row from "foo" to "bar". This results in a table with one row of "foo" and one row of "bar".

For the header table, we again select the first row and insert it into the table as a new row. However this time when we try to use the row.ReplaceText method to change the text on the new row from "foo" to "bar", it replaces the value on the initial row as well. This results in a table where both rows are "bar"

DominicJL avatar Jul 12 '19 15:07 DominicJL

Hi, You are right, there is a problem. This will be fixed in v1.7. Until then, you can go in file Xceed.Words.Net/Src/Container.cs, in method "ReplaceText", and add the following condition before doing the replacement on header and footer: if( this is DocX )

XceedBoucherS avatar Oct 03 '19 12:10 XceedBoucherS

Hi @XceedBoucherS , Is there an estimated release date for version 1.7?

DominicJL avatar Feb 05 '20 10:02 DominicJL

Hi, It won't be long : Spring 2020 or earlier. Thank you.

XceedBoucherS avatar Feb 05 '20 15:02 XceedBoucherS