1. Zhen Feng Saw
  2. PowerBuilder
  3. Monday, 7 November 2022 08:42 AM UTC

Hi all, 

I had face a issue where the column's text does not wrap to new line in datawindow when print preview. I had tried to tick the auto vertical scroll, auto horizontal scroll and increased the column height but still no working. Any help is greatly appreciated. Thanks.

 

John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 8 November 2022 02:29 AM UTC
  2. PowerBuilder
  3. # 1

Hi, Zhen -

The implicit line breaks and "auto-wrapping" only occurs when the string contents being displayed or edited contains white space (spaces, tabs, new lines, etc.), as Andreas pointed out in his reply. If the data contains no white space, no wrapping or auto-adjustment of height will occur and data will display only as a single line of text. This is way Windows handles string data in single-line edit controls and PowerBuilder emulates this behavior in the DataWindow.

Below is a link to an example program in CodeXchange that shows you one way to change this behavior:

   https://community.appeon.com/index.php/codeexchange/powerbuilder/280-string-break-adds-line-breaks-to-strings-by-analyzing-content#430

I'm not sure if it will help you with the particular issue that you experiencing, but you might consider taking a look at it.

Best regards, John

Comment
  1. Zhen Feng Saw
  2. Tuesday, 8 November 2022 07:35 AM UTC
I've tried to include spaces in my data, and the wrapping work. Thank you so much.
  1. Helpful
  1. John Fauss
  2. Tuesday, 8 November 2022 14:37 PM UTC
That is great news, Zhen! Would you please take a moment and mark this issue as resolved? Thank you!
  1. Helpful
There are no comments made yet.
Zhen Feng Saw Accepted Answer Pending Moderation
  1. Tuesday, 8 November 2022 01:44 AM UTC
  2. PowerBuilder
  3. # 2

Hi Andreas,

Appreciate your reply. I'm currently using PB 2019, and yes I want to wrap the highlighted text as my image and I'm using a freeform datawindow.

I've tried your suggested method but it still didn't work on my site. 

ZhenFeng.

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Monday, 7 November 2022 09:47 AM UTC
  2. PowerBuilder
  3. # 3

Hi.

Version of PB you are using?

The text you want to wrap is the one in the screenshot? What type of datawindow?

The following example is with a grid datawindow.

The second column will wrap if:

  1. In column: Position -> Autosize Height Property is checked.
  2. In detail band: Autosize Height property is checked.
  3. Text in second column has spaces. Spaces are needed as they are used to find where to change line.

Andreas.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.