Powerbuilder ‘Gotcha’ – Autosize Height and strings

Posted on Friday, June 25th, 2010 at 8:20 pm in

So I have a datawindow which displays some information in rows about invoices for a customer. There is a ‘notes’ column which contains whatever the salesperson entered at the time of the order. Generally you would want to make sure the column in the datawindow for these notes is flagged with the autosize height property on and the band within which it is contained is similarly marked (so the user can see all of the notes entered). So far so good.

Now you submit your code to QA for testing and it is rejected; reason – only one line prints/is visible.

You spend your time double checking the field length, the autosize height property, the database table, etc. You re-run your test and, well, “it works for me”.

The issue is the auditor testing the application looks at the specs and sees that 500 characters are allowed in the notes field.

“Well, if that’s the case then I’ll just hold down the ‘A’ key until the space is filled up.”

Autosize height works like a simple word wrap. Without any formatting characters like spaces or line breaks it doesn’t know where to wrap. Have the auditor cut and paste ‘normal’ text (just like the end user would do anyway).

You might also be interested in


Add your comment

  1. Shaun - August 20, 2010 at 1:15 pm

    Thanks you sooo much for this post! I was in the very same situation today – and your post saved me a lot of further (and unnecessary!) research time!

  2. Form Generator - August 23, 2010 at 5:09 pm

    hey man I like it. I’m ready to write more articles and put your ideas to the test. After all, we always have something new to learn and being humble, I came here to learn. Bookmarked.

    – Andre

  3. Online Poker - September 12, 2010 at 9:59 pm

    Took me time to read the whole article, the article is great but the comments bring more brainstorm ideas, thanks.

    – Johnson

  4. jave - April 4, 2013 at 8:51 am

    Sometimes column’s value must display long text without any spaces (e.g long URLs).
    To wrap text in these cases, an expression can be used in the format tab.

    lets say your text will reach the end of the column’s width after 40 chars.
    to wrap a 100 chars of text in the column you can use the following format:
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ (40x@, space, 40x@, space, 20x@).

    Trying to set the above format in the painter crushed my PB (12.5), so instead I used the following formating expression:
    fill ( fill ( ‘@’, 40 – 1 ) + ‘ ‘, truncate ( len(url_text) / 40 , 0 ) * 40 ) + fill ( ‘@’, len(url_text) – truncate ( len(url_text) / 40 , 0 ) * 40 )

    fill ( ‘@’, 39 ) + ‘ ‘ ==> format template for one line of 40 chars
    truncate ( len(url_text) / 40 , 0 ) * 40 ==> the number of full lines (for 100 chars it will be 2)
    len(url_text) – truncate ( len(url_text) / 40 , 0 ) * 40 ==> the number of chars in the last partial line

Leave a Reply