Skip to main content
Answer

How to keep a dollar figure together in one line in forms

  • May 14, 2025
  • 8 replies
  • 136 views

Sometimes, a dollar figure such as $123.45 included in line description might be split into two lines after the “.”, i.e.

The first line looks like: some description $123.

The second line looks like: 45 more description

Setting the option CanSplit to False partially solves it but introduces another similar issue that a dollar figure such as $1,234.56 might be split into two lines after the comma, i.e.

The first line looks like: some description $1,

The second line looks like: 234.56 more description

Is there anyway to always keep the dollar figure together in one line?

Best answer by DrewNisley

Could you try this slightly complicated expression? It’s a lot to look at, but I couldn’t come up with a better way to do it. It worked for me using your two example descriptions. If your descriptions are ever longer than two lines, I can change it to accomodate for more lines.

=
/*This checks if there is a dollar sign requiring a page break*/
IIf(InStr(Right(Left([DESCRIPTION], 105), 30), '$')<>-1,

/*This is the part of the description before the dollar sign*/
Left([DESCRIPTION], 75) +

/*This is the section with the dollar sign and the line break*/
Replace(Left(Right(Left([DESCRIPTION], 105), 30), InStr(Right(Left([DESCRIPTION], 105), 30), '$')+1), '$', '{br}') +

/*This is the rest of the description*/
Right([DESCRIPTION], Len([DESCRIPTION])-InStr(Right(Left([DESCRIPTION], 105), 30), '$')-75),

/*This just prints the description normally if there is no dollar sign that would need a line break*/
[DESCRIPTION])

Basically it is taking apart the whole description and putting it back together with a line break. I set it to look between characters #75 and #105 for a dollar sign and add a line break behind it so that it keeps it together. It also will only do it for the first one it finds, that way if there are multiple, you won’t get multiple line breaks.

I couldn’t look at the report, so I couldn’t check the field name, just replace the DESCRIPTION with whatever the field name is.

Hope this helps!

8 replies

Forum|alt.badge.img
  • Varsity I
  • May 17, 2025

Can you not expand the field a bit to fit more data in there?  I think can grow moves it down not wider.


Forum|alt.badge.img
  • Jr Varsity III
  • May 17, 2025

@shane62  can you please share the screenshot


  • Author
  • Freshman II
  • May 19, 2025

Can you not expand the field a bit to fit more data in there?  I think can grow moves it down not wider.

Thanks for your reply.

Unfortunately, that is not a permanent solution. Expanding the field slightly might work for this time, but when line description gets longer or shorter in another invoice, the same issue will happen again.


  • Author
  • Freshman II
  • May 19, 2025

@shane62  can you please share the screenshot

Thanks, here you go:

 


Forum|alt.badge.img
  • Jr Varsity III
  • May 19, 2025

@shane62  may i know is this a standard report or customization?

Or can you please share me the report here so that i can check and try to resolve your issue.

 

Click on Edit report so it will download your report and please share here.


Thanks


  • Author
  • Freshman II
  • May 19, 2025

@shane62  may i know is this a standard report or customization?

Or can you please share me the report here so that i can check and try to resolve your issue.

 

Click on Edit report so it will download your report and please share here.


Thanks

It is one of the standard forms PM641000, literally nothing special. You can use any form like AR invoice, Sales Order etc. for testing as long as there is a line description field available. The key point is when the line description reaches certain length, the dollar figure embedded in the description would be split into two line.

 

I attach mine for your reference. And you can use the following two line description for testing. Very luckily, when I change the CanSplit option, one of the lines will have the issue.

4. 1 slab of Pietra Grigio 018 ; 5.25 SQM @ $187.00 / SQM = $981.75 : less previous payment of $490.88 + GST

5. Kitchen Benchtop - Pietra Grigio 018 Honed ; 1 UNIT @ $7,500.00 = $7,500.00 : less previous payment of $2,250.00 + GST


DrewNisley
Pro I
Forum|alt.badge.img+3
  • Pro I
  • Answer
  • May 19, 2025

Could you try this slightly complicated expression? It’s a lot to look at, but I couldn’t come up with a better way to do it. It worked for me using your two example descriptions. If your descriptions are ever longer than two lines, I can change it to accomodate for more lines.

=
/*This checks if there is a dollar sign requiring a page break*/
IIf(InStr(Right(Left([DESCRIPTION], 105), 30), '$')<>-1,

/*This is the part of the description before the dollar sign*/
Left([DESCRIPTION], 75) +

/*This is the section with the dollar sign and the line break*/
Replace(Left(Right(Left([DESCRIPTION], 105), 30), InStr(Right(Left([DESCRIPTION], 105), 30), '$')+1), '$', '{br}') +

/*This is the rest of the description*/
Right([DESCRIPTION], Len([DESCRIPTION])-InStr(Right(Left([DESCRIPTION], 105), 30), '$')-75),

/*This just prints the description normally if there is no dollar sign that would need a line break*/
[DESCRIPTION])

Basically it is taking apart the whole description and putting it back together with a line break. I set it to look between characters #75 and #105 for a dollar sign and add a line break behind it so that it keeps it together. It also will only do it for the first one it finds, that way if there are multiple, you won’t get multiple line breaks.

I couldn’t look at the report, so I couldn’t check the field name, just replace the DESCRIPTION with whatever the field name is.

Hope this helps!


  • Author
  • Freshman II
  • May 20, 2025

Could you try this slightly complicated expression? It’s a lot to look at, but I couldn’t come up with a better way to do it. It worked for me using your two example descriptions. If your descriptions are ever longer than two lines, I can change it to accomodate for more lines.

=
/*This checks if there is a dollar sign requiring a page break*/
IIf(InStr(Right(Left([DESCRIPTION], 105), 30), '$')<>-1,

/*This is the part of the description before the dollar sign*/
Left([DESCRIPTION], 75) +

/*This is the section with the dollar sign and the line break*/
Replace(Left(Right(Left([DESCRIPTION], 105), 30), InStr(Right(Left([DESCRIPTION], 105), 30), '$')+1), '$', '{br}') +

/*This is the rest of the description*/
Right([DESCRIPTION], Len([DESCRIPTION])-InStr(Right(Left([DESCRIPTION], 105), 30), '$')-75),

/*This just prints the description normally if there is no dollar sign that would need a line break*/
[DESCRIPTION])

Basically it is taking apart the whole description and putting it back together with a line break. I set it to look between characters #75 and #105 for a dollar sign and add a line break behind it so that it keeps it together. It also will only do it for the first one it finds, that way if there are multiple, you won’t get multiple line breaks.

I couldn’t look at the report, so I couldn’t check the field name, just replace the DESCRIPTION with whatever the field name is.

Hope this helps!

 

Hi Drew, that is a great idea! I updated the expression to include a new part of checking the length of the description and also re-wrote it to be like this:

=IIf( 
/*check if the length of the description is greater than or equal to 105*/
Len([ARTran.TranDesc]) >= 105 
/*and check if there is a $ character from the position 91 to 105*/
And InStr( Right(Left([ARTran.TranDesc], 105), 14), '$') <> -1, 
/*if so, add a line break before the $ character*/
/*this is the before $ part*/
Left([ARTran.TranDesc], 105 - 14 + InStr( Right(Left([ARTran.TranDesc], 105), 14), '$')) + 
'{br}' + 
/*this is the after $ part*/
Right([ARTran.TranDesc], Len([ARTran.TranDesc]) - 105 + 14 - InStr( Right(Left([ARTran.TranDesc], 105), 14), '$')), 
/*If no $ found, just display the original description*/
[ARTran.TranDesc] )