Livecycle Designer - print pages from expanding sections

Avatar

Avatar

SunsV

Avatar

SunsV

SunsV

03-02-2015

Hi,

I have a possibly complex situation. I have a large form divided into about 5 sections. Each section has expanding text fields and information panels. The information panels are there to help the user fill out each field with appropriate information, however, when the form is printed the info panels are set to disappear. This all works fine as it should do.

However, the client has had feedback and sometimes they want to print out single sections. What they have been doing is noting down the page numbers then sending to print only the pages they need. However, this isn't working well enough as once the info panels disappear (which is done automatically) the page numbers no longer coincide with what is being printed.

My solution would be to have a button for each section which would print a span of pages from the start of one field/section to the end of another field/section. Bearing in mind that these points aren't going to be on the same page for each of the filled forms is there a way of doing this?

Apologies here, but in terms of programming I'm a beginner, but hopefully a quick study!

View Entire Topic

Avatar

Avatar

SunsV

Avatar

SunsV

SunsV

05-03-2015

Ahh, no, it doesn't quite work.

Throughout a section I have info boxes - these are text boxes wrapped in a subform called info1a, info1b etc. which are set to be hidden pre print - and post print they are set to visible. This works in itself.

However the code above still counts the page numbers within the section prior to the info boxes being hidden - in other words, the info boxes cause the pages to be printed to extend beyond the section as if the info boxes were still there, even though they are not.

If I have two buttons - one to set the visibility of the info boxes to hidden and then click another button to print the section then it works fine, but I can't amalgamate the instructions into one single button.

Here's what I have so far:

Button one - to hide info boxes:

form1.summary.Button1[2]::click - (JavaScript, client)

  this.resolveNode("form1.summary.info1a").presence = "hidden";

this.resolveNode("form1.summary.info1b").presence = "hidden";

this.resolveNode("form1.summary.info1c").presence = "hidden";

Button two - to print the section:

form1.summary.Button1[0]::click - (JavaScript, client)

var vObj = xfa.resolveNode("form1.summary"),

  vPageStart = xfa.layout.absPage(vObj),

  vPageEnd = vPageStart + xfa.layout.absPageSpan(vObj) - 1;

xfa.host.print(1, vPageStart.toString(), vPageEnd.toString(), 0, 0, 0, 0, 0);

I have tried to amalgamate both instructions into one button but this doesn't work:

form1.summary.Button1[0]::click - (JavaScript, client)

  this.resolveNode("form1.summary.info1a").presence = "hidden";

this.resolveNode("form1.summary.info1b").presence = "hidden";

this.resolveNode("form1.summary.info1c").presence = "hidden";

var vObj = xfa.resolveNode("form1.summary"),

  vPageStart = xfa.layout.absPage(vObj),

  vPageEnd = vPageStart + xfa.layout.absPageSpan(vObj) - 1;

xfa.host.print(1, vPageStart.toString(), vPageEnd.toString(), 0, 0, 0, 0, 0);

can anyone help?