问题
I'm trying to use a parameter field as a notes box for a report, where when you run it, you can freely enter notes into the parameter and it will display as a text box on the form. However, I've found you cannot enter a Carriage Return(new line).
Anyone know a way to enter a new line in a parameter for crystal?
回答1:
I don't think Crystal can handle multi-line parameters. You could use multiple parameters, one for each line, or use a printable character like #
as a placeholder in the text, and substitute it with newlines in a formula.
回答2:
Figured it out. Created a parameter field called notes, then a formula field to alter the notes.
Replace ({?Notes},"." ,"."&ChrW (10) )
That replaces any periods with a .period and a new line.
回答3:
Also, with SAP Crystal reports, you can use a JavaScript line break ("br" surrounded by "<>") to split the parameter prompt into two or more lines, just plop it into the prompt text wherever you want a new line. A little off topic, but I came here to find this and figured I'd leave it here for anyone else.
And for added fun, you can use the "img src" tag to directly embed images into a parameter, dunno why you would but you can.
回答4:
A quick solution is to create a Formula Field which Can Grow and use text & carriage return & text
e.g.
"This is how to do a" & CHR(13) & "Line Break"
Will appear as:-
This is how to do a
Line Break
来源:https://stackoverflow.com/questions/9201262/enter-a-carriage-return-in-a-crystal-reports-parameter-field