The print capabilities of UltimateForms are awesome. Especially considering that out-of-the-box SharePoint has no print functionality at all. Using Word Templates to build carefully formatted output is a flexible and accessible way to get great looking PDF print output from any SharePoint form. If you have not yet built a Word print template, be sure to try this by walking through the steps in this article.
What about a scenario where you are using associated items functionality to include a repeating table as shown in this timesheet example:
In this case, I have a print template for the parent list record AND a print template for the child list records. There is one parent record for the timesheet, but I might have many child records related to it. I can print each individually, but that means I will have several different PDFs which is inconvenient!
How can I print the parent records and the child records all at once and get that as one PDF?
We have a new Attach to current item feature that handles this all for you! You only need two actions to get the desired result. We will use the Print List Items Action twice to get everything we need and consolidate it to a single PDF.
Once you have your Word print templates created, one for the parent list and one for the child list, you are ready to add the first Print List Items Action to the parent record. This print action will create a PDF of each child record, then attach those PDFs to the parent record:
In the settings shown above we are selecting the child list, targeting the child records using the special "Parent field name" reference, selecting the print template, specifying PDF output, using the special "Attachment" option for target and opting to attach output to the parent record with overwrite option enabled.
Your action can be triggered using whichever conditions you need. It might be when a Status field changes to complete or a manually triggered Action. Test out this action to ensure that this step works properly before moving on to the next step. If everything works correctly, you should see the attachments on the parent record which will look like this:
On the parent record, we need to add one more Print List Items Action which will print the parent record and consolidate the attached PDFs into the same PDF file. This action is straight forward:
In this second action, we select the current record using the ID = [ID] setting, select the print template, use PDF output, specify the target to a local document library, use a dynamic reference for the file name (suggest including $Month([Now])-$Day([Now])-$Year([Now]), CHECK THE ATTACH DOCUMENTS OPTION, select the document library and enable the Allow overwrite option.
This action will produce one PDF where the beginning of the report is the output from the parent record and then the attached PDF records are appended as additional pages. Note that your output can sent via email automatically if you wish as an alternative.
When it comes to forms using Associated Items functionality this is an incredibly beneficial feature. Now you can produce one consolidated report using the precision of Word print templates and eliminate the hassle of needing to produce multiple separate files!