Formatting text stored as Binary

Formatting text stored as Binary

  
Hi,

I am importing data set including a field with large (7000+ char) text records.  To store this I am having to use a binary format but this means when I display it on screen I lose all formatting (bullet points, line breaks etc). and the text appears as one long paragraph.

Is there a way that I can store the formatting of the text and have it appear on screen in the same manor as it is imported?

Thanks
Dan



Hi Daniel,

Can you explain a bit more what kind of transformation you are doing to the text?
I don't see why you have to convert into a binary (even if it's for storage, entity text attributes can have large sizes)

...and even with a conversion from text->binary should be 100% reversible since it is just a simple encoding

Regards,
João Rosado
Hi Daniel,

What format is your text in? HTML? When you display the text, I assume you are using an Expression widget? If so, did you set "Escape Content" to "No"?
Dont forget to wrap it in a pre-tag or a container with styling as a pre-tag if it's non html
Hi guys,

Thanks for the replies, it seemed that the Excel file we were uploading wasnt holding the formatting through our ETL rather than in OutSystems, once loaded in formatted state it holds and is displayed correctly. 

We had to convert to binary because when using a Text format it deosnt like anything over 2000 characters, we have text strings upwards of 7000 so had to convert.
Thanks for the replies
Dan

Hi Daniel,

Can you detail a bit more what "doesn't like anything over 2000 characters"?
The Text attributes defined in the platform when Length > 2000 are declared in the database as NVarchar(Max), Clob or LONGTEXT (depending on what database is used).
Those datatypes have technically no limit, so regrardless of what length is defined if it is over 2000 there is no limits on the database.

So I'm curious where you are hitting the problems.

Regards,
João Rosado
In the past I have seen an error message warning me that the text being loaded will be truncated etc but I have just created a test app to check this and it has loaded in as you have explained above.  Not sure whether there was another setting difference which affected it but seems I will be using Text rather than Binary fields going forward again.
Daniel,

"String or binary will be truncated" is a database error that warns you that you try to put more characters in a database field than it can hold. This has nothing to do with the maximum length a field can have.