I have a template docx file. In the template, there is a 10x1 table with placeholders (D1,D2,D3.....D10). I have a replaceTable method to replace the placeholders in this table with records returned by a SQL query. For the placeholder D3 alone, it needs to be replaced with values from 2 String variables (say str1 and str2). The requirement I have is to be able to replace D3 with str1 + newlinecharacter + str2.
str1 = "abc"; str2 = "def"
D3 should be replaced with:
Due to obvious reasons, concatenating the st1 and str2 with \r\n and then replacing D3 does not work, as the new line character gets converted to a space during replacement. Any help is appreciated.