cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a subform @ bottom of last page without reserving space for it

Former Member
0 Kudos

Hello gurus,

I have a small challenge for you guys :-):

Iu2019m developing an adobe print form for an invoice and have to write a subform at the bottom of the page but only if it is the last page. Said like this the requirement doesnu2019t seem so special at all which I agree with you but, if add to the problem that I must not reserve a place (on master page) to it so I can minimize the paper loss and use the maximum space of the page for the invoice items/taxes etc (for the container) and only write the subform at bottom if it is available space left it turns the problem a little bit more complex, isnu2019t? If case there isnu2019t available space in the u201Ccurrentu201D last page to write it I should provoke a page-break to write it at bottom of the u201Crealu201D last page.

Iu2019ve tried to put the subform on the master pages (FIRST and NEXT) overlapping the end of the correspondent containers and hide it for all the pages that werenu2019t the last one but in some cases the subform content is overlapping the invoice items.

Do you have any suggestions how to achieve this?

Thanks in advance.

Regards,

Alexandre

Accepted Solutions (0)

Answers (4)

Answers (4)

OttoGold
Active Contributor
0 Kudos

I don´t have a working demo of that two master pages approach. Was just an idea and I wanted to know if it works.

But I have one more, less experimental idea, which I have implemented some time back and am sure, it works.

Follow me:

- fill the data into the table (done automatically, of course, but a must for the event to work = pick event after you got the data into the table...) (not a real work)

- count the number of lines (easy, piece of cake)

- get the height of one row (easy, piece of cake)

- compute how many pages are occupied by the table lines

- compute how many lines are present on the last page

- compute how many lines are needed to make the last page "full"

- use the last number to compute a height of a blank subform (no content but has size), set the height, which will make the "footer" (the one we are talking about here) go to the bottom of the page

Every needed reference is here:

http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...

http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf

Especially the last chapter of the JS reference.

Regards Otto

Former Member
0 Kudos

Hello Otto. Thank you very much for your helpfull answer.

I'm trying to do as you told, and I also found a thread on the Adobe forum that seems with my problem.

All that I have to do is explained there, but I didn't get do the same way as the person did.

The link is http://forums.adobe.com/message/1362254#1362254

And now I have to know how to :

- Find the Y position where my footer is now placed.

- Find the blank space left in the content area(probably using pageContent()?) and use it to increase the height of my blank subform, leaving my footer in the correct place.

Thanks again and I'll keep trying...

OttoGold
Active Contributor
0 Kudos

Please share the "feeling of the winner" when you get content. Only then my advise had sense:)) Good luck with the details, regards Otto

Former Member
0 Kudos

Hey Guys,

I have the solution for this. I have resolved it by using the below code.

Create sub form "SUB1" in the main page. After creating the subform add two numerical fields 'N1' & 'N2' to the sub form and choose the presence as Hidden(Exclude from layout).

Step 1:

Initialization event of N1..

" For Current page

this.rawvalue = xfa.layout.page(this);

Initialization event of N2

" Total Number of pages

this.rawvalue = xfa.layout.pagecount( );

Step 2:

In the 'Layout:ready' event for the subform "SUB1"

if ( $.N1 <> $.N2 ) then

$.presence = "hidden"

endif.

Former Member
0 Kudos

Hi Javeed, thanks for your suggestion.

I have this code in my footer subform, it makes the subform to appear only on the last page. Ok, but I have another problem.

If I make this way(putting the subform in Master page), in my last page if the data reach the bottom of my content page, I will have an overflow with the footer.

And if I put my subform in my body page, I will gonna have my footer after the last data in the form. I'm trying to find how much blank space I have in last page and then force the footer to go to the bottom of page.

But I had no sucess yet.

Former Member
0 Kudos

hi,

take u r subform at the last in the body bage and make the bodypage as flowed..i think this will work.

Thanks,

Madhukar..

Former Member
0 Kudos

Hi guys.

I have exactly the same problem than Alexandre. I didnt find here any solution to do this. The customer doesnt want to lose space in previous pages then I couldn't reduce my content area.

Otto, can you explain how to work with 2 master pages? How do I control the second one to be only the last one?

Or what can I do to know how many blank space I must insert to "force" my subform(footer) go to the bottom of page?

Should I open a new thread about this question?

Thanks all in advance.

Fábio

OttoGold
Active Contributor
0 Kudos

The best shot would be to have 2 master pages, one for the last page only, and find out, how to force to use of this master for the end of the form content. I am not usre if that could be done trhough some scripting or if there is a trick with pagination of some kind. But with these two options you should play a little. At least I would do it this way (try to do that). Otto

OttoGold
Active Contributor
0 Kudos

Hello,

I don´t understand your problem. Master page doesn´t help here, that is obvious (or you would have to use at least 2 masters, one for the document and second for the last page only). But you must work with the content: flowed, there is a sequence of your forms/ subforms in the hierarchy and one of the subforms is the last one, placed on the last page.

Maybe I have missed something important but why this is not enough? iF it would not be enough, you can always ask the field or a subform "on which page am I?" and "how many pages does the document have in total" and compute is first = second (that means last in total).

Regards Otto

Former Member
0 Kudos

Hello Otto,

Thanks for your fast reply.

Yes it's true but the problem is that I want to force the write of subform at the bottom of the last page and not somewhere in last page. And at the same time I don't want to have blank spaces on the place where should be positioned the subform on the rest of the pages.

Did I make it more clear to you?

Is this possible to do?

Regards,

Alexandre

Former Member
0 Kudos

Hi Alexandre,

I am facing the same problem. How did you solve your problem?

Please let me know.

Thanks in Advance

Arpita

Former Member
0 Kudos

Hi Arpita,

No, unfortunately not.

What I did was reduce the height of the bodypage to unsure that the bottom data didn't overlap the bodypage data in the last page.

Regards,

Alexandre

OttoGold
Active Contributor
0 Kudos

I wonder why didn´t you use the two master pages approach? It didn´t work? Can you please explain why?

Just in case that really doesn´t work, you can always count the number of rows, compute (when you know the height of the row and of the content area) how many blank rows you need to add, what will force the footer to stay at the bottom.

Otto