i have a string that i want to export on excel file with openxml component in C#. My text has '\u001f' character and openxml has error with this character. error text: "hexadecimal value 0x1f, is an invalid character".
i copy that test directly to excel and no problem and copy is success.
Does OpenXml have configs for solving this problem or How i can solve this problem.
thanks.
You need to write it using the format
_xHHHH_
whereH
represents a hexadecimal character. In your particular instance you need to set the value to"_x001F_"
.From the documentation for a Cell Value:
In turn, the
ST_Xstring
(taken from the ECMA-376 standard) is documented as: