1. Joe Hess
  2. PowerBuilder
  3. Wednesday, 3 July 2019 14:28 PM UTC

I have a column in the detail section of the datawindow. Autosize Height is checked. The design height of the column is 276.

The column height resizes properly. I would like to adjust the positioning of other objects based on the height of the column. However, the height always returns 276. Is there any way to get the new height of the column?

Thanks,

Joe

Accepted Answer
Michael Kramer Accepted Answer Pending Moderation
  1. Wednesday, 3 July 2019 15:20 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Joe, right combo of these properties usually means no need to know exact height:

  • AutoSizeHeight
  • Visible - using expressions
  • Computed field - using expressions to make text = "" (empty)
  • Slide Up AllAbove vs DirectlyAbove

I right now have DW with 20 columns, static texts, and computed fields float around.
I got it working one object at a time.

 

Calculate Column Height

Unfortunately there is no direct way to calculate height of control having AutoSizeHeight=true.

However, assume you have just one column that changes height dynamically - and that increase increases row's height.
Now, this expression will tell you increase of height. (TEST: Add as computed field to see value)

long(Describe("Evaluate('RowHeight()'," + GetRow() + ")")) -  long(Describe("DataWindow.Detail.Height"))

HTH /Michael

 

Comment
  1. David Peace (Powersoft)
  2. Wednesday, 3 July 2019 16:26 PM UTC
Hi

As Michael said you need to make the other elements of the DW slide Up. Then they will move relative to the auto-size height column.



Usually directly above is most effective, use all above when you want it to slide relative to all the columns above.



Hope that helps

David
  1. Helpful
  1. Michael Kramer
  2. Wednesday, 3 July 2019 16:57 PM UTC
On complex layouts sometimes WYS-ain't-WYG.

I'm creating Elevate 2019 presentation on a dozen PowerScript tips. I may add tip on Autosize + sliding to make it a Baker's dozen.
  1. Helpful
There are no comments made yet.
Joe Hess Accepted Answer Pending Moderation
  1. Tuesday, 9 July 2019 16:03 PM UTC
  2. PowerBuilder
  3. # 1

Evaluating the row height was the quickest solution. I wanted to keep a minimum height. I was able to use that to adjust the detail band height and the Y of other objects as needed.

 

Thanks, everyone!

Joe

 

 

Comment
There are no comments made yet.
Ricardo Colarina Accepted Answer Pending Moderation
  1. Friday, 5 July 2019 03:13 AM UTC
  2. PowerBuilder
  3. # 2

Hi Joe, I also had problems at times with autosize height in complex DW.  I did something like what Michael suggested above.  But since my DW has more than 1 autosize height column, I instead used a child DW with a single autosize column, which I change to the width of the column I want to check the new height, populate that column with the value, then get the new height as suggested above.

Comment
  1. Michael Kramer
  2. Saturday, 6 July 2019 08:43 AM UTC
Neat! You have my vote.
  1. Helpful 2
  1. Ricardo Colarina
  2. Tuesday, 9 July 2019 03:17 AM UTC
Thanks
  1. Helpful 1
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.