Ask Your Question
0

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

asked 2018-02-17 15:50:21 +0200

Andy Gleeson gravatar image

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

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2018-02-17 17:50:24 +0200

Ratslinger gravatar image

Hello,

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 ✔ (upper left area of answer). It helps others to know there was an accepted answer.

edit flag offensive delete link more

Comments

Thanks thats just what I needed

Andy Gleeson gravatar imageAndy Gleeson ( 2018-02-17 19:17:52 +0200 )edit
0

answered 2018-02-18 13:25:19 +0200

Andy Gleeson gravatar image

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";"")

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-02-17 15:50:21 +0200

Seen: 137 times

Last updated: Feb 18 '18