How to display newline characters as new lines
Apex 4.1
I have a table with a notes column varchar2(4000). It is filled by a textarea on a form. An example of the contents could be:
This widget specifies AB
This second line says AC
Lets assume that the notes also contain strings that should be escaped when displaying as HTML (it's a bit difficult to post an example in this forum)
In a report, I want this column to display literally as entered, i.e.:
- The second line displays after the first
- Special characters/strings are not interpreted as HTML
I tried this:
select notes from emp
The newlines are never displayed, no matter what the "Display Text As" setting is.
select replace(notes, chr(13) || chr(10), '
') as notes from emp
Display Text as 'Standard Report Column'
This displays the newlines correctly, but does not escape the special characters.
If I do escape the special characters, then obviously the
is also escaped.
select '<pre>'||notes||'</pre>' as notes from emp
This also renders newlines correctly but other tags are (curiously) not displayed.
So I can't really find a solution for what I want. Suggestions?