on 10-23-2016 7:05 AM
I'm seeking advice on how to display an .xml file, retrieved from the database as a blob, in PB's rich text edit, without losing the xml format. I'm using PB12.5.
The application reads in and process data from .xml files. I also store the .xml file's content as a blob along with other particulars of the .xml document. This 'save document' function uses the same code to save text documents that are also processed by the application.
Once saved, the User can open a response window to display the ‘content’ of saved documents.
To display text documents, the blob is retrieved using embedded SQL and converted to a string with
ls_string = TRIM(String(blob_text, EncodingANSI!))
The string is pasted into the rte display using the code below, which works ok for formatted text documents, but not for XML - the content is retrieved but the formatting is lost.
ls_richtext = '{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fnil\fcharset0 Calibri;}}{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang7\f0\fs22 ' + ls_string + '\par}'
li_rc = rte_text.PasteRTF(ls_richtext)
Should I be using something other thatn 'EncodingANSI! ?
Thanks again, Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just another thought ... what about using the iNET object to interact with an XML website ( http://www.webtoolkitonline.com/xml-formatter.html ) or calling a web service to format your XML string and then return it to your PB application?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also ... FYI: http://www.rgagnon.com/pbdetails/pb-0186.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi William;
Have you tried ...
ls_string = TRIM(String(blob_text, EncodingUTF16LE!))
Regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your interest, Chris.
Yes, I'd tried EncodingUTF16LE but got hieroglyphics.
EncodingUTF8! and encodingansi! both presented the data but not formatted.
As an interim measure, I've presented the xml in a MS Word ole, which displays the data in a structured format but minus the tags. So the data can be comprehended albeit without the tags which offer a clue to what the data items are about.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.