PO Line Description ignores carriage returns

I wish I knew when this changed so I could pinpoint the problem, but my users have just been “dealing with it” for a while now and never told me when it changed. The issue I’m having is the Line Description that is printed on a PO form is crammed into one continuous sentence and will grow in height, but if the description on the PO is setup with multiple lines, carriage returns, those are ignored. I went to 10.2 on Sept 1st and I don’t know if this is when the problem started, but I’m still using the same customized report that we had in 10.1. I did not start with a new form and re-edit it with our changes because it appeared to print correctly when we did our testing.

This is how the base SSRS report prints, our customized one prints the same way.

But this is how the line description is entered.
image

Any info on why this would be doing this is appreciated. I tried changing the description field on the report from the CalcLineDesc that it is originally to the raw LineDesc field from the PODetail table and the formatting was still the same. I’m guessing it has something to do with how the field is selected in the Expression area will change the layout but I’m not good with SSRS expressions.

Was that description entered manually (typed by hand), or populated with a copy and paste? The original data might not have carriage returns or line feeds.

1 Like

Depending on the input, you can look to add a replace within the SSRS field expression and see if that helps.

=Replace(Fields!YourColumn.Value, Chr(13), Vbcrlf)

2 Likes

It was manually entered by hand with carriage returns. The problem is persistent across multiple PO’s as welll, and even when you go and edit the description and re-enter it with carriage returns it prints the same way.

I’m very green when it comes to modifying SSRS reports so I’m not quite sure what you mean by this.

I’ve looked at the base RDL for the POForm SSR, and it uses a field named Fields!Calc_DtLineDesc.Value Which means the the RDD (Report Data Definition) is what tweaking your PO Line Description. (You can tell this because its a calculated field).

1 Like

Correct and as noted in my first post, I edited the RDD to include the PODetail LineDesc field, vs the calculated field, added that to the SSRS report and then put that as the field to be displayed and it still printed the same way.

1 Like

Can anyone confirm that theirs acts the same way?

I see the same (line breaks not being honored) for the Calc_… field, in both 10.1.400 and 10.2.300.

Will test using the PODetail LineDesc field

1 Like

FWIW - the Calc_DtLineDesc.Value filed in the SSRS DB does contain CR’s, but no LF’s

image

So do like @mshier said, and use that Replace function to replace the lone CR, with a CRLF combo.

1 Like

Base POForm with the expression updated to:

=Replace(Fields!Calc_DtLineDesc.Value, Chr(13), Vbcrlf)

image

And what it looked like with the orginal expression

image

2 Likes

I can confirm that it works as well. Thanks!

=Replace(Fields!Calc_DtLineDesc.Value, Chr(13), Vbcrlf)

Well the rabbit hole just got deeper… I was given a PO from May that printed correctly and tried that PO number using the base report style and it was on multiple lines. I tried it using the modified report and now each line is double spaced, so the solution does work but the question is why does the new way they are entering data cause it to be on one line vs what they did in May. UGH!

The change could be anything from how the UI saves the field to the DB, to the way the RDD calculates that field. I’m not even sure what “calculations” are done on it.

Your getting the double space because when the field already has CRLF, your replacing it with CRLFLF.

If the double spacing bothers you, try

=Replace(Replace(Fields!Calc_DtLineDesc.Value, Chr(13), Vbcrlf), Chr(13)+Chr(10)+Chr(10), Vbcrlf)

The inner replace changes CR to CRLF, and the outer replace replaces CRLFLF with CRLF.

Hello[CR]World! becomes Hello[CR][LF]World!
Hello[LF]World! stays Hello[LF]World!
Hello[CR][LF]World! becomes Hello[CR][LF]World!,
… by first becoming Hello[CR][LF][LF]World!
… and then becomes Hello[CR][LF]World!

4 Likes

Thank you! that script works perfect and both the previous May PO and new Nov PO print the same way. I could not find any difference between the two in how the description is entered.