Solved

Show text (CSV, HTML, XML, JSON, etc..) in Document previewer

  • 11 September 2019
  • 4 replies
  • 237 views

Userlevel 5
Badge +20
We like to show the contents of interface messages in a previewer control.

I found out that this is possible with an expression field, with the formula like below and use a domain with control type HTML.

'
body {
font-family: Calibri, Tahoma, Arial;
font-size: 14px;
font-weight: bold;
}
' + REPLACE(REPLACE(REPLACE(t1.message_body, '<', '<'), '>', '>'), CHAR(10), '
') + '
'

It is nice, but it does not fully give the desired output.

Any suggestions?
icon

Best answer by Anne Buit 12 September 2019, 16:54

View original

4 replies

Userlevel 7
Badge +5
Hi Harm,

I suppose you are trying to get rid of HTML control characters in the XML?

Instead of the replaces, you can try to use the XML formatter in SQL Server to escape the characters:

code:
(select t1.message_body as [*] for xml path(''))
Userlevel 5
Badge +20
Hi Anne,

Thanks for your reply.

In this case the purpose is a technical screen, not for regular end users.

I like to see the actual XML data, like when you open an XML file in NotePad, Notepad++. If possible with language specific formatting.

The same for TXT, JSON, SQL etc.

I hope you see a solution.

Br,

Harm
Userlevel 7
Badge +5
Which GUI platforms are we talking about? The Windows GUI does have a code editor available that can highlight various programming languages.
Userlevel 5
Badge +20
For now, the Windows Gui.

I will try your suggestion, but prefer using the document previewer because it uses all available space.

A combination of both would be ideal.

Reply