Enter a Carriage Return in a Crystal Reports Parameter Field

杀马特。学长 韩版系。学妹 提交于 2019-12-23 02:58:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!