Wrap text in report module

Hi there,

I have some long text like the format :
企业微信截图_17309645631433

When I try to display the words use text of the report, it looks like:

I understand it maybe a standard style for wrap, but is it posiible to fill the first line first and then wrap?
企业微信截图_17309652823213

Thanks in advance.

If your text really is a long string with no whitespace in it, you may have to insert your own whitespace at a pre-defined position within that field to force it to wrap. I have seen ways to do it in Perspective with CSS, but I don't know of a way to do it in Vision/Reporting without basically inserting it manually.

Yeah, my application is to have a text area for user to input some notes, then record the text to MySQL database, finally display the notes on report.
I found it will work well if I have some whitespace at the end of each row of text area.


However, requiring users to pay attention to this detail during input may not be very user-friendly. If there is a way to automatically add two spaces at the end of each line, it would be great.

They're not mentioned in our manual, for whatever reason, but Reportmill, the underlying Java library that powers reporting, has some built-in functions to interact with strings that might be helpful: https://www.reportmill.com/support/keychains.pdf

Specifically, the wrap function looks like it might do what you want:

wrap(limit): Returns the base string wrapped to limit chars, separated by newlines.

Another alternative would be to use a script data source to rewrite the input from the query and do a replace("\n", "\n ") - replace newlines with newlines + two spaces.

3 Likes

Thanks Paul, this is a really good suggestion.
In my application, the input text is Chinese, and may be mixed with English and numbers, so in many cases it had unexpected results. I will even tried Python textwrap module.
To temporarily solve this problem,in text area of vision window, I deselected the "Line Wrap" option and let user manually wrap when the number of characters reaches a certain number, this action made the result look good.
The new question is there any idea to limit the characters of each line of text area. If more than that number it will wrap automatcly with the end of "\n".