cancel
Showing results for 
Search instead for 
Did you mean: 

decode does not work for line breaks

Former Member
0 Kudos

Hi experts,

In a BLS, I am decoding a string which I output . It decodes the spaces but not for linea breaks. What is wrong ¡?

Thanks and best regards,

Antonio Rodriguez Rubalcaba

Accepted Solutions (1)

Accepted Solutions (1)

jamie_cawley
Advisor
Advisor
0 Kudos

Can you provide an example and explain the goal?

Regards,

Jamie

Former Member
0 Kudos

Hi, Jamie

I have a web page where the end user captures text and save it to a database. I do not have any applet on the page . I use servlets and xls to format the data . This text is being escaped when the user input text and being unescaped using JavaScript . No problem at all this far .

Also, the end user wants the page to be "sent" via email to them .In other words, I need to send HTML email. So I created a BLS which uses the HTML Loader action and then I use the Send Mail action to send the string content of the HTML loader action .

I found that the unescape javascript code is not being executed when the HTML loader action takes place . Yeap, I know . The java script code is only not executed at the client side and not at the xMII server . So I turned my attention to the BLS decode function . I applied the decode to the text entered by the user and saved at the database and found that works fine for all the spaces but not for line breaks .

Jamie, I appreciate very much your kind help on this .

Best Regards,

Antonio

Former Member
0 Kudos

Jeamy,

I forgot the examples .

Best regards,

-


NOTE

-


Note : Copying and pasting the text into the note pad shows no problem ( it has linebreaks ) . This is also true when I copied the decoded thext from the INFO section of the Transaction execution onto this message . However , the BLS OUTPUT does not have line breaks .

-


UNDECODED TEXT EXAMPLE

-


I use the following expression : "Text = " & IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/NOTA} and I get the following :

INFO : Text = REPRESENTACION%20NUEVO%20LAREDO.-%20SE%20RECIBE%20LOTE%20DE%20GAS%20DE%20IMPORTACION%20POR%2015%2C000%20BLS.%20FLUJO%20DE%20RECIBO%201%2C322%20BPH.%20%0D%0AINICIO%20EL%20RECIBO%20AYER%20A%20LAS%2023%3A50%20HRS.%0D%0A%0D%0AREPRESENTACION%20CADEREYTA.-%20EXISTENCIA%20BOMBEABLE%2010%2C000%20BLS.%0D%0A%0D%0ATDGL%20POZA%20RICA.-%20EXISTENCIA%20BOMBEABLE%206%2C000%20BLS.%0D%0A%0D%0ALPG%20DUCTO.-%20SE%20PRESENTO%20FALLA%20EN%20LA%20ESTACI%D3N%20NO.%204%20DE%20REBOMBEO%20SUSPENDIENDO%20EL%20FLUJO%20DEL%20LPG%20DUCTO%20DE%20LAS%2004%3A50%20A%2005%3A05%20HRS.%0D%0A%0D%0AB/T%20ANAFI.-%20ARRIBO%20EL%2010.02.2011%20A%20LAS%2006%3A00%20HRS.%20PARA%20DESCARGAR%2020%20MTM%20DE%20AMONIACO%20EN%20LA%20TDGL%20TOPOLOBAMPO%2C%20SE%20ENCUENTRA%20FONDEADO.%0D%0A%0D%0AB/T%20GASCHEM%20HAMBURG.-%20CONTINUA%20DESCARGA%20DE%20AMONIACO%20EN%20LA%20TDGL%20TOPOLOBAMPO.%20DESCARGADO%206%2C430%20TM%2C%20POR%20DESCARGAR%208%2C570%20TM.%0D%0A%0D%0AB/T%20BW%20BOSS.-%20ETA%2001.03.2011%20PARA%20DESCARGAR%2046.8%20MTM%20DE%20GAS%20LP%20EN%20LA%20TR%20PAJARITOS.%0D%0A%0D%0ACOATZACOALCOS%3A%20CONTINUA%20EL%20ENVIO%20DE%20BUTANOS%20A%20LA%20REFINERIA%20MINATITLAN.%0D%0A

-


DECODED TEXT EXAMPLE

-


I user the following expression : "Text = " & IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/NOTA} and I get the following :

INFO : Decoded Text = REPRESENTACION NUEVO LAREDO.- SE RECIBE LOTE DE GAS DE IMPORTACION POR 15,000 BLS. FLUJO DE RECIBO 1,322 BPH.

INICIO EL RECIBO AYER A LAS 23:50 HRS.

REPRESENTACION CADEREYTA.- EXISTENCIA BOMBEABLE 10,000 BLS.

TDGL POZA RICA.- EXISTENCIA BOMBEABLE 6,000 BLS.

LPG DUCTO.- SE PRESENTO FALLA EN LA ESTACI�N NO. 4 DE REBOMBEO SUSPENDIENDO EL FLUJO DEL LPG DUCTO DE LAS 04:50 A 05:05 HRS.

B/T ANAFI.- ARRIBO EL 10.02.2011 A LAS 06:00 HRS. PARA DESCARGAR 20 MTM DE AMONIACO EN LA TDGL TOPOLOBAMPO, SE ENCUENTRA FONDEADO.

B/T GASCHEM HAMBURG.- CONTINUA DESCARGA DE AMONIACO EN LA TDGL TOPOLOBAMPO. DESCARGADO 6,430 TM, POR DESCARGAR 8,570 TM.

B/T BW BOSS.- ETA 01.03.2011 PARA DESCARGAR 46.8 MTM DE GAS LP EN LA TR PAJARITOS.

COATZACOALCOS: CONTINUA EL ENVIO DE BUTANOS A LA REFINERIA MINATITLAN.

jamie_cawley
Advisor
Advisor
0 Kudos

If you set the content-type to text/plain this should work. If you want an html formatted email, you would have to put the test into an html table.

Jamie

Former Member
0 Kudos

Hi Jamie,

No, I do not want a html formated email . Neither i can use the text/plain option for the message type content of the SendMail action.

I am sending a whole HTML page with html tags . If I use the text/plain , I will be sending the code of the HTML page to the end users .

Please note that the only problems happens when I use the decode BLS function wich works fine except for the line breaks , The BLS output is :

REPRESENTACION NUEVO LAREDO.- SE RECIBE LOTE DE GAS DE IMPORTACION POR 15,000 BLS. FLUJO DE RECIBO 1,322 BPH. INICIO EL RECIBO AYER A LAS 23:50 HRS. REPRESENTACION CADEREYTA.- EXISTENCIA BOMBEABLE 10,000 BLS. TDGL POZA RICA.- EXISTENCIA BOMBEABLE 6,000 BLS. LPG DUCTO.- SE PRESENTO FALLA EN LA ESTACI�N NO. 4 DE REBOMBEO SUSPENDIENDO EL FLUJO DEL LPG DUCTO DE LAS 04:50 A 05:05 HRS. B/T ANAFI.- ARRIBO EL 10.02.2011 A LAS 06:00 HRS. PARA DESCARGAR 20 MTM DE AMONIACO EN LA TDGL TOPOLOBAMPO, SE ENCUENTRA FONDEADO. B/T GASCHEM HAMBURG.- CONTINUA DESCARGA DE AMONIACO EN LA TDGL TOPOLOBAMPO. DESCARGADO 6,430 TM, POR DESCARGAR 8,570 TM. B/T BW BOSS.- ETA 01.03.2011 PARA DESCARGAR 46.8 MTM DE GAS LP EN LA TR PAJARITOS. COATZACOALCOS: CONTINUA EL ENVIO DE BUTANOS A LA REFINERIA MINATITLAN.

This BLS output is missing the line breaks .

Best Regards,

Antonio Rodriguez Rubalca ba

jamie_cawley
Advisor
Advisor
0 Kudos

Maybe I'm not fully understanding the issue, but if you send the email with the content-type as text/html line breaks will not work. You can't mix the formats up and expect it to work, either you send only text in and the line breaks will work or you only send in html with the text is a table.

Jamie

Former Member
0 Kudos

If you are going to use html formatting, you can try the PRE tag:

http://www.w3schools.com/tags/tag_pre.asp

Answers (0)