Need more, need help now?
- - - - - - - - - - - - - - - - - - pay-as-you-go support - no contract - tenth of an hour billing - expert help - fast service - no call queues
Need integration?
- - - - - - - - - - - - - - - - - - with your shipping system - website - invoicing system - crm - cms - manufacturing - order import - back to back orders..
Need a report?
- - - - - - - - - - - - - - - - - - Excel reporting that pulls data from Sage - custom layouts - layouts that change adapt to your brands and/or for drop shipping.
Want web hosting?
- - - - - - - - - - - - - - - - - - Your own domain name - email - a shop - wordpress - woo commerce - ticket systems - help desks - forums - portals

Controlling Line Breaks in Variable Length Expression

Report design issues and solutions.
Post Reply
NutsAndBolts
User
User
Posts: 2
Joined: 16 Jan 2026, 13:29
Sage Version: v30 UK/Europe/Africa

Controlling Line Breaks in Variable Length Expression

Post by NutsAndBolts » 16 Jan 2026, 13:54

(Report Designer v7.0.72.0)

My company sells products with radically varying amounts of invoicing information - sometimes just a name, sometimes a name, part number, HS tariff code, country of origin, batch code, supplier conformity certification code, trace code etc.

To cut down on white space, I've used an expression to concatenate whichever fields are populated and put it in an auto-growing box in my report. This works reasonably well, but the strings themselves also vary in length considerably, so if I give them each a newline it often wastes a lot of space. I prefer to seperate them with "|"s on one line and allow it to wrap, but this then can introduce line breaks in the middle of a field ( "Turnip | Carrot | Sweet
Potato" ).

I'd like automatic line breaks, but only inbetween fields, not within them. Of course, Unicode gave us the non breaking space for this reason, and reports will accept them and interpret them correctly, but maddeningly, they'll be replaced with placeholder "?"s when you actually export the document as a PDF for email.

I suppose I could track a running total of character length and insert line breaks when the total would otherwise break into a new line, but that potential rats' nest of nested IF() functions seems pretty unwieldy.

Is there any other way to supress line breaks within certain sections of an expression?

User avatar
brucedenney
Site Admin
Site Admin
Posts: 4668
Joined: 28 Feb 2006, 09:56
Sage Version: v30 UK/Europe/Africa

Re: Controlling Line Breaks in Variable Length Expression

Post by brucedenney » 16 Jan 2026, 14:07

Hi

The strategy you are using is the problem as you have no control over the line breaks.

The way I would do this is to have footer sections for each line and a conditional format that supresses the printing of the line if there is no value.

So if there are potentially 5 lines I woudl have 5 footers, each woudl be suppresed if the contents was blank.

Yuo can see this strategy/technique in invoice layouts wher ethe comments are each in thier own section and supressed when empty.
For just about anything Sage :- Discount subscriptions, pay-as-you-go support, application integration, reports, layouts, linked excel spreadsheets, analysis or any other help making life with sage easier/less time consuming Contact me.

NutsAndBolts
User
User
Posts: 2
Joined: 16 Jan 2026, 13:29
Sage Version: v30 UK/Europe/Africa

Re: Controlling Line Breaks in Variable Length Expression

Post by NutsAndBolts » 16 Jan 2026, 14:54

Is this solution able to join the strings into one line? Having them all on seperate lines is what I am trying to avoid.

User avatar
brucedenney
Site Admin
Site Admin
Posts: 4668
Joined: 28 Feb 2006, 09:56
Sage Version: v30 UK/Europe/Africa

Re: Controlling Line Breaks in Variable Length Expression

Post by brucedenney » 16 Jan 2026, 15:10

If you have separate lines, you have control over where the line breaks are, if you put all the fields into one string, you have no control.

This avoids blank lines and allows you to control where the line breaks happen.

You could concatenate a few strings on each line, but if the line is wider than can be printed it will still wrap with no control.

...............

Perhaps you could build a huge string with delimeters in it between each group of words you are not wanting to split.

Assuming x chars fit on a line

You then chop the line up into separate strings less than x chars and with a delimeter at the end of each making sure all the words stay together on the line.

Each string then gets printed using its own footer section to supress it if it is empty.
For just about anything Sage :- Discount subscriptions, pay-as-you-go support, application integration, reports, layouts, linked excel spreadsheets, analysis or any other help making life with sage easier/less time consuming Contact me.

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests