1. Berka Frenfert
  2. PowerBuilder
  3. Thursday, 1 December 2022 11:14 AM UTC

Q: Why a column with Autosize Height = Yes is not returning the new height at runtime?

Its a column for a lot of junk text.

Problem: Always return me the height i set in design mode.

A message returns wrong height with following expression

Long(Describe("dragon_butts.height"))

 

Regards,

Berka

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 13 January 2023 05:57 AM UTC
  2. PowerBuilder
  3. # Permalink
Hi Berka; Exactly. That is also what I said in my previous reply. You get the original height from the DWO's source code. Not the current height. I am surprised that the Evaluate method does not work for the current working height. Please create a Support Ticket for this and if you have, attach a small test case to the ticket. This will allow Engineering to delve into this issue deeper. Many thanks in advance. Regards ... Chris
Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 1 December 2022 11:51 AM UTC
  2. PowerBuilder
  3. # 1

Hi.

Autosize height changes the height in each row depending of data in column. As a result column may not have the same size in all rows. That's why definition remains what it was in design time, so you always get initial value.

One workaround would be to use rowheight() in a computed field. But even this would return row's height and not column's height! So this may be a workaround depending on what exactly you want to achieve.

Andreas.

 

Comment
  1. Berka Frenfert
  2. Thursday, 1 December 2022 12:01 PM UTC
Is there a way i can set priority sequence of computed fields? i mean which computed field gona solve its expression first if i have just two?

btw: i got the idea about how rows height can be used to get column's height. need to try first.
  1. Helpful
  1. Andreas Mykonios
  2. Thursday, 1 December 2022 12:24 PM UTC
Each row will calculate rowheight in computed field. So depending on the row from which you read the value of computed field, you may have different result.

Andreas.
  1. Helpful 1
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 1 December 2022 19:40 PM UTC
  2. PowerBuilder
  3. # 2

Hi Berka;

  The Describe() is giving you the height in the DWO "Source" and not in the display buffer.

You might want to try using the Evaluate() command for this (just a guess)

https://docs.appeon.com/pb2022/datawindow_reference/XREF_58632_Evaluating.html

Regards ... Chris

Comment
  1. Berka Frenfert
  2. Friday, 2 December 2022 07:43 AM UTC
Evaluate returned same fixed height set in design mode.

Describe( 'Evaluate("Describe(~'dragon_butts.Height~') ", 1 )' )



Same As

Describe( 'dragon_butts.Height' )



I guess last option is RowHeight() function
  1. Helpful
  1. Berka Frenfert
  2. Friday, 2 December 2022 07:49 AM UTC
Hi Chris,

describe() as you said picks height from source which is not new height. Is there way to reach "display buffer"?



True Regards,

Berka

  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Saturday, 3 December 2022 00:50 AM UTC
  2. PowerBuilder
  3. # 3

Hi, Berka - 

Perhaps an alternative way to look at using Describe to report on the height of a column object is to realize that the Describe method does not provide any way to specify a row number. Since Autosize Height means that the column object's height can match or exceed the design height from row-to-row based on the data, the only alternative is for Describe to report on the height of the column object as it is defined in the DW Painter.

Best regards, John

Comment
  1. Berka Frenfert
  2. Wednesday, 7 December 2022 09:51 AM UTC
Hi John,

Exactly, describe function does what it supposed to do. Evaluate() function takes row as parameter and again returns height the one set in design mode. As Chris already said describe picks height from source, i was wondering if there was way to reach system memory where DataWindow stores its objects and their properties. I guess there is no easy way to explorer that place in memory.

My understandin is that the current height is calculated on the fly. Height at runtime can be calculated for example i can add height of all vertical columns in a tabular DataWindow excluding the one with AutoSize Height set, also use Rowheight() and with + / - somehow height can be calculated. Also the bands heights other than the Detail band. But things gonna be too messy that way :-)

I just ignored that report where i needed the calculation because mostly making reports is not my job. I will try again to resolve this issue in few days, otherwise i will go for support ticket.

Thanks a lot for more information you provided.

True regards

Berka
  1. Helpful
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.