Incorporing data to Excel with perl/html

Roxxien

Active Member
Joined
Jul 5, 2017
Messages
289
Hello everyone,

I'm currently using a cloud ERP with an option to create correspondance with Template Toolkit. This software uses perl to extract information from the database and some "kind" of html for the format.

My problem is the following : I need to have my information writed on multiple line in 1 Excel cell. However, it can't changes line at any place but at specific place (when encounter this character ). My initial logic is then to replace that character by a jump line.

For the moment, I'm able to replace the character any other that I want even chr(10) which normally create what I want. But, for now, Excel consider it like a space. If someone have any idea on how to solve this, it will really help me.

Here is my code that I currently have.
Code:
[% descriptif= line_item.product.description |xml %]
[% descriptif= descriptif.replace([B]'•'[/B], [B]"\n"[/B]) %]
<cell text=[B]"[% line_item.product.description |xml %]"[/B]/>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I found a solution after 2 days of work on that problem.

Instead of creating some "jump line" with an Ascii character, I'm pasting each string in a different row/cell

Here is the solution if someone want it.

Code:
        [% descriptif= line_item.product.description |xml %]
        [% descriptifarray = descriptif.[COLOR=#0000FF]split[/COLOR]([B]'•'[/B]) %]
        [% n = [COLOR=#800000]0[/COLOR] %]
        [% [COLOR=#0000FF]FOREACH[/COLOR] descriptif.[COLOR=#0000FF]split[/COLOR]([B]'•'[/B]) %]
            [% [COLOR=#0000FF]IF[/COLOR] descriptifarray.[COLOR=#800080]$n[/COLOR] != [B]""[/B] %]
                <row>
                    <cell></cell>
                    <cell text=[B]"[% descriptifarray.$n %]"[/B]/>
                </row>
            [% END %]
            [% n = n + [COLOR=#800000]1[/COLOR] %]
        [% END %]
 
Upvote 0

Forum statistics

Threads
1,225,678
Messages
6,186,398
Members
453,352
Latest member
OrionF

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top