Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Optionally print a page

mdawn50
Level 7
Level 7

Hello- In a form I'm working on, the owner of the form wants page 1 instruction page to not print, but they want the user to have the option to print page 1. I've used presence = "hidden" in the prePrint and presence = "visible" in the postPrint event of the page and that works successfully. I'm not sure how to give the user the option to print.

Thanks,

MDawn

1 Accepted Solution
Niall_O_Donovan
Correct answer by
Level 10
Level 10

Hi,

I find that when dealing with the relevant property, you also need to pair this with the presence property. For example:

if (this.rawValue == 0) {

     page1.presence = "visible";

     page1.relevant = "-print";

}

else {

     page1.relevant = ""; // clear relevant property

     page1.presence = "visible";

}

Another option would be to use the presence property only:

if (this.rawValue == 0) {

page1.presence = "hidden";

}

else {

page1.presence = "visible";

}

And then in the postPrint event, show page1 again:

page1.presence = "visible";

See the example here: http://assure.ly/h7whb8.

Hope that helps,

Niall

View solution in original post

6 Replies
kingphysh
Level 7
Level 7

Hi,

Here is the scripting method you would incorporate into a complete scrpt:

Reference_Syntax.relevant = "+print";  //prints regardless of "presence" property

Reference_Syntax.relevant = "-print";   //does not print regardless of "presence" property

Good luck!

Stephen

past-tense
Level 4
Level 4

Put a check box on the instruction sheet, then in the change event of the check box, set:

Reference_Syntax.relevant = "+print";

or

Reference_Syntax.relevant = "-print"; 

depending on whether the box is checked (you can set the .relevant of an entire page). Using .relevant is better than .presence, as it prevents (or allows... -print/+print) the page from printing, but doesn't hide the page on screen, so there is no flicker while it's printing.

If you need the actual code, just let me know, but this should be enough to get you going.

- Scott

mdawn50
Level 7
Level 7

Which event would I place this on?

Margaret Dawn

mdawn50
Level 7
Level 7

I put this script in the prePrint event of the page that I want to have the option of printing or not.

if

(this.rawValue == 0){

page1.relevant

="-print";

}

else

{

page1.relevant

="+print";

}

The content of the page is not appearing, however, the page is printing with just the header. How can I have no page print?

Thanks,

MDawn

Niall_O_Donovan
Correct answer by
Level 10
Level 10

Hi,

I find that when dealing with the relevant property, you also need to pair this with the presence property. For example:

if (this.rawValue == 0) {

     page1.presence = "visible";

     page1.relevant = "-print";

}

else {

     page1.relevant = ""; // clear relevant property

     page1.presence = "visible";

}

Another option would be to use the presence property only:

if (this.rawValue == 0) {

page1.presence = "hidden";

}

else {

page1.presence = "visible";

}

And then in the postPrint event, show page1 again:

page1.presence = "visible";

See the example here: http://assure.ly/h7whb8.

Hope that helps,

Niall

View solution in original post

mdawn50
Level 7
Level 7

That worked. It's doing exactly what I needed. Thanks,

MDawn