cancel
Showing results for 
Search instead for 
Did you mean: 

How to get table height grow dynamically?

0 Kudos

Hi Experts,

Iam developing an adobe form with header and line item details. The client wants that inspite of whatever be the number of line items,the table containing the line item should have a height upto 10mm from the footer. ie even if i have only one line item,the table height should be fixed on a page.How do i make the table dynamically grow downwards upto 10 mm from footer always

Correct answer will be awarded points

Accepted Solutions (1)

Accepted Solutions (1)

pavan_prabhu
Active Participant
0 Kudos

Hello Hari,

     The content area will never grow if the number of items gets increased. It is the sub form which grows if the number of items get increased. So declare the content area with the static size you want(say 90 mm i.e 10 mm above footer). And let the table sub form flow as usual.

Now the trick here is that the horizontal bottom border should be given at the content area level and not at the sub form level. This will ensure that the table height is always 90 mm i.e 10 mm above footer. And you can provide the Horizontal top border either at sub form level or content area level. It doesn't matter. And if you are providing vertical lines for columns, draw the lines from top to bottom of content area in Master Page. So if you do this way, you don't even need to increase the height of the columns of the table through scripting. Then this Problem will be solved.

0 Kudos

Thanks Pavan,

Iam aware of the option mentioned by you but can't employ in this case because of the following reason.

On the top of the table(and within the table itself) before the line item section starts there is another row containing purchasing notes which can be of any number of lines.So this upper row can come down to any distance depending on the lines of purchasing notes.Hence we can't draw a table as background on the master page.

pavan_prabhu
Active Participant
0 Kudos

Hello Hari,

     Then in that case, you need to increase the height of individual columns dynamically. For that you need to write the JavaScript in Layout Ready event.


So you have to assign the maximum height of the whole DATA sub form to the minimum height of each field in the table.

Currently I assume that the sub form name of the DATA sub form of table is DATA.

var maxheight = xfa.layout.h( DATA, "mm" );

this.minH = maxheight + "mm";

0 Kudos

Hi Pavan,

Do you mean that for each column of the table i need to assign the maximum height of the table to the minimum height of those columns?

Also do i just give "mm" or should it be some value? iam sorry, i don't know much of scripting

pavan_prabhu
Active Participant
0 Kudos

Hi Hari,

     The script which I provided will assign the maximum height of a table row to the minimum height of the columns. So all columns will end at same level. And you can give "mm". It should work.

konchada_saikrishna
Active Participant
0 Kudos

Hi Pavan,

Please don't treat it as a critisize,

After visualizing your logic, making rest of the rows equal to a max height might drive rows fitted in the screen flow to next and leaving the current page still not up to the bottom.

ex: lets say we start at 0 and content area is of height 90.

now if we have 3 rows of height 10,20,31 = 81 as per your logic 31X3 = 93 so last row flows to next.

and the current page ends up with 2 rows = 62 still less than 90.

Advise me if my understanding of your logic is variant.

Cheers,

Sai

Answers (3)

Answers (3)

navip
Active Participant
0 Kudos

Can you please share your issue with screen-shots??

---

Naveen

0 Kudos

The layout looks somewhat like the screenshot above.The table height should always be 10 mm up from footer no matter if it is just 1 line item,3 etc.In the case when the line items are more,the table box extends right upto the bottom(including the footer part) and the remaining part goes to the next page where the footer will be displayed at the bottom

Former Member
0 Kudos

Hi hari,

I hope you want to fix the height of the body row of table to single line.

If I am correct then have you tired un-checking "Allow multiple lines" option in field of table row.

Thanks,

Vishwa

Former Member
0 Kudos

Hi Hari

You can add an invisinle rectangle, that is 10mm high, in the upper part of the footer.

that way the flow will 'cut' the table if it reaches the rectangle/10mm from the footer.

Regards

Shai.

0 Kudos

Hi Shai,

I guess the requirement has not been clear to you.The table containing the line items should always have a fixed height.Presently if there is one line item it will be say around 10mm high and when two line item 20 mm etc. The requirement is that whatever be the number of line items,the table height should be fixed that is 10mm up from footer(say 90mm).

The table is inside a content area that grows as per the number of line items. The content area will be small if the line items are less and will grow bigger(more height) if the table is bigger and that is the problem.

It is possible to fix the height of the table using scripting. I need a technique to increase the height of the columns of the table as well through scripting.

konchada_saikrishna
Active Participant
0 Kudos

Hi Hari,

What I understood is, if your footer is @ 90MM to 100 MM = 10 MM height.

Your tables should be 1MM to 90 MM.

Now if the table has 1 record (line) the height of the row should be 90MM

Slly if its 2 records height of the row should be 45MM and if its 3 then 30 MM each.

If my understanding is correct, please explain what do you want when the table flows to next page ?

Whats the minimum height you need so that user can read the content in a row, it also depends on how many columns, which column data is expected more driving it to so that if cannot fit in a 3 MM row when it has 20 lines. of course I understand if the table goes to next page with only 1 record, the record should have 90 MM height.

Please advise, I can give you the script accordingly

Cheers,

Sai

0 Kudos

Sai,

The rows need not be of same height always as there can be dynamic item texts etc.When the table flows to the next page it has to go right down to the bottom of the first page and in the next page if it ends then the footer will be displayed(this requirement is taken care of).

There are no horizontal lines seperating the rows. So if there are 3 records(which need not be 30mm each),there should be a table with 3 records one after the other and the table should end at 90mm.

You can find the sample screenshot in my reply to Naveen below

konchada_saikrishna
Active Participant
0 Kudos

Hi Hari,

As pavan advised one way to go is find out which is max data in a column, loop through and re align columns, my understanding is there are a lot of if and buts which we cannot catter in forecast.

As you dont need horizontal lines and always footer touching the data, What I would say is remove the border lines for the row. if you look in  your example screenshot that border line is making you feel the table is ended there.

For visuality if that line is gone it looks as if the data is up until the footer

Cheers,

Sai