Expand my Community achievements bar.

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

Avatar

Former Community Member

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

Former Community Member

It is, although requires a few lines of code:

Pseudo-ish:

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

Avatar

Former Community Member

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