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

Is there a way to remove blank sections of a form before printing?

Avatar

Level 1

I am working on a form, which when printed, will become a report. Some parts of the form will not be used by all users.  I am wondering if it is possible to hide tables, or text boxes and fields, if the user does not fill in that section.  Also, will the sections below automatically move up to fill in the blank spaces? It is a dynamic form with expandable boxes, so main subform of each page is set to 'flowed'.  We only want the final report to print with the sections of the form that were actually filled in.

 

Thank you,

Amy

2 Replies

Avatar

Level 4
Level 4

It is, although requires a few lines of code:

Pseudo-ish:

for each (subforms as subform) if (AllFieldsOfSubformAreEmpty(subform)) subform.presence = "hidden";

Avatar

Level 1

Thank you for the quick reply.  I'm afraid I'm not very comfortable with scripting.  I think need a little more detailed instructions.  I know how to get to the script editor window, but not sure what do do once there.  Can I cut and paste the script info you posted? I also don't know what to choose in the top left drop down box of script editor.  (Sorry I can't be more specific, but I don't have access to the program right now.) I have a lot of tables on the form, which I think work like they are wrapped in a subform, but it doesn't say they are wrapped in a subform in the hierarchy. I'm assuming I would need a different script for those.  

Thanks,

Amy