How can I format text field in base report eg "£ 160"

I would like to format text fields in base reports so for instance when the price field is 160 the text box will display “£ 160” and when the height, width and depth fields are 10, 20 and 30 respectively the text box will display “H 10 x H 20” x D 30" it would also be nice if the depth is 0 to only display the height and width. I have spent a lot of time searching for info on how to do this but have drawn a blank.

I am using Libreoffice 5.3 on Linux Mint


Most all of what you wish to accomplish is done simply by changing the Formatting of the field in Report Builder.

For the Pound symbol:

image description

instead of the dollar sign (if default as mine is), use the dropdown (under Format column) and select what is wanted.

For dimensions, you can format the three individual fields with constants (directions also found in off line help) as follows:

image description

The constants here are surrounded by quotes.

Then you can have the three fields print (H, W, D) with a label field between each. The label field would contain a value such as " X " so you would end up with L 10 " X W 12 " X D 3 ". Of course exact format for what you want is at your discretion. Additionally, the last two fields ( X D 3") you may choose not to print if that value is zero. You can do this with a Conditional Print Expression.

Here is a portion of an example:

image description

Again, refer to the help files and also the LO documentation - found here.

If this answers your question please tick the :heavy_check_mark: (upper left area of answer). It helps others to know there was an accepted answer.

Thanks thats just what I needed

It is amazing how a bit of assistance (and thanks again for that) can get you over the initial hump. My final solution is below this allows the use of a single text box so ensuring correct spacing of the elements as the field lengths change.

="H "&[Height]&“mm x W “&[Width]&“mm”&IF([Depth]>0;” x D “&[Depth]&“mm”;””)