Skip to main content
Solved

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

  • Sep 11, 2019 12:53 PM UTC
  • 4 replies
  • 311 views

Harm Horstman
Superhero
Forum|alt.badge.img+21
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?

Best answer by Anne Buit

Which GUI platforms are we talking about? The Windows GUI does have a code editor available that can highlight various programming languages.
View original
This topic has been closed for replies.

4 replies

Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • Sep 11, 2019 3:08 PM UTC
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(''))

Harm Horstman
Superhero
Forum|alt.badge.img+21
  • Author
  • Superhero
  • Sep 11, 2019 7:30 PM UTC
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

Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • Answer
  • Sep 12, 2019 2:54 PM UTC
Which GUI platforms are we talking about? The Windows GUI does have a code editor available that can highlight various programming languages.

Harm Horstman
Superhero
Forum|alt.badge.img+21
  • Author
  • Superhero
  • Sep 12, 2019 6:52 PM UTC
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.