Thank you Masters.
I have another problem:
I wrote code to make BOM base on ComponentReport of TIG. Then I place data on a html datatable.So I have to replace all "\n" by "<br>" like this:
Then the datatable looks good. Then I save data in a .xlsx file. Still look good when openned in Excel. But when I inserted it to LayOut, it create "x000D" before every new line in cell. Please help me how to solve this. Thanks a lottt.