cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the height of growing subform

Former Member
0 Kudos

Hi Experts,

I am trying to find the height of growing subform at runtime. But I could'nt is there any way i can find it.

I am using the below formcalc script in the event layout read.

<variable>.Value = Subform.h

all the time i get the value as 0.

Regards,

Krishna

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Firstry try to see if you get the Height using a MessgeBox.

$host.messageBox("Height is :"+Subform.h)

While assigning you have to use rawValue so use

<variable>.rawValue = Subform.h

Former Member
0 Kudos

Hello,

Thanks for the response.

I am trying to find the height of subform of type flowed which grows dynamically at runtime.

eg:

SUBOFRM -A Flowed

Contents(Grows dynamically)

1

2

3

4

etc..

I have used the correct camel case <variable>rawValue = subform.h.

I wrote this in event layout ready... and all the time i got the value as 0in.

Regards,

Krishna

OttoGold
Active Contributor
0 Kudos

I am sure the layout ready event is not right. I tried myself (wanted to manipulate the height and use the default height).

Unfortunatelly I don´t have time to to find a suitable event for you. Why don´t you try the same simple code above on all the events? You can do that outside SAP in LCD to speed it up. I am looking forward to hear the answer.

Regards Otto

Former Member
0 Kudos

Hello Otto,

Thanks for your suggestion, couple of days back I used one of the layout methods to find the height of the growing subform.

this.RawValue = xfa.layout.h(<subform>, 'mm');

The above javascript code works in the event "Calculate" and in event "Layout ready" all the other events is returning the height as '-1'.

Basicaly I have two bodypages as shown below my requirement is to find the height of a subform in first bodypage and if it reaches a particular height I want to insert a page break using conditional break in SUBFORM2.

PAGE1

- SUBFORM1(Bodypage1)-> ContentArea1

- SUBFORM2(Bodypage2)-> ContentArea2

Condtional break code on SUBFORM2.

Height  > 80

Break Before "X" Goto top of Content Area <ContentArea2>

Unfortunately the conditional page break is not working now so trying hard to find a solution to it, please let me know if you have any suggestions here.

Thanks,

Krishna

OttoGold
Active Contributor
0 Kudos

Hello,

it is 23.11 pm here and I am on my way to bad, so I hope this is relevant, but:

I don´t use conditional pagebreaks at all, I do everything by myself - scripting.

Procedure:

- create an empty subform (no content = no reserved place, no problem)

- make it hidden

- place a condition where you test something you like (like the height, number of items etc.)

and when the condition is met, you make the subform visible and then and only then the pagebreak applies.

Important detail: you must place this "help" subform into every single row and use relative addressing.

Hope that makes sense and could help here.

Regards Otto

Former Member
0 Kudos

Hi,

I used this FormCalc script but the height of my subform isn't changing.

I have 2 subforms, 1 flowed (name= Item) and 1 positioned (name= Quantity).

The height of the flowed one needs to be assigned to the positioned one before output.

So I created a FormCalc event on my second subform (Quantity):

this.h = xfa.layout.h(Item, 'in');

Am I doing something wrong?

Thanks in advance.

Regards,

Niels

Answers (0)