Print multiple items in two SharePoint Lists

  • 19 April 2017
  • 9 replies
  • 4 views

Badge +3

I have a SharePoint 2013 and Nintex Enterprise Forms 2013 and Nintex Enterprise Workflows 2013 licensed farm.

I have 2 Lists List1 and List2. List1 has a hyperlink column that may have an entry that points to an item in List2.

What I'm being asked to do is provide one pdf file via the 'Print to PDF' Nintex Form Feature or some other means to print an item in List1 and if it is associated via the Hyperlink column in list1 to a 2nd Item in List2 that it prints both items from the 2 lists into 1 PDF file.

Does anyone have any comments/ideas on how this could be accomplished utilizing Nintex Forms/Workflows and/or OOB SharePoint, javascript etc??

thanks!

Frank


9 replies

Badge +7

Hi,

I could imagine the following approach ...

- Two Lists (List1 and List2)

- List1 has a column of type "number" called "List2Id" (containing the Item-ID instead of an hyperlink)

- List2 has a couple of entries, List one has at least one entry where the hyperlink is pointing to an item in List2

202010_pastedImage_1.png

202013_pastedImage_4.png

When I open the "List 1 - Foo" item I get the following form:

202014_pastedImage_5.png

This would turn into a corresponding PDF.

To achieve this result I added a listitem-control to the form pointing to "List2" and using the value from the column "List2Id".

202015_pastedImage_6.png

I would further only display this control when the form is in Display-Mode and the List2Id actually contains a value.

202016_pastedImage_7.png

Similar I would only show the List2Id-Control when the form is in Edit- or New-Mode.

Userlevel 7
Badge +17

That'll work ‌, It just matters how custom your form is on List2, can it be recreated in the List1 form? Then you can show/hide just like henning describes. Its a very good solution.

You will have to have a single form and print from that form only.

What happens if you use a page viewer control? That would be the only other way to embed the List2 form. I think you will get the other sharepoint items (nav and ribbon) in the view, so it's not ideal.

Badge +7

The PageViewer was my first thought - although not the best happy.png

You could use the Hyperlink-column easily with the pageviewer, just point the pageviewer to the value of the hyperlink column (in my case I called it "List2Link" and append "IsDlg=1" to hide to the quick-launch as well as the top-nav.

202040_pastedImage_2.png

The result could look like this:

202041_pastedImage_3.png

However - the generated PDF seems unexpected:

202042_pastedImage_4.png

I would guess, the print-to-pdf action did not expect an Iframe here ...

Userlevel 7
Badge +17

That's interesting, didn't think that would happen.

Userlevel 7
Badge +17

you should short blog that feature of using isdlg. I would have overlooked that.

Badge +3

I appreciate the feedback and I'll try implementing this to see if it'll satisfy my requirements.

For some context here on what I'm trying to do is as follows:

I have 1 List that has Events that occur throughout the day. When an Event Occurs it may or may not have 1 or more corresponding Incidents that are reported in a 2nd List. The Incidents List may have Photos embedded in a Multi Text Field/Column in the 2nd List. When a Incident item is associated to an Event the end user would create a Link in a column on the Events List Item that points to the Incidents Items.

I was asked if I could develop a solution where when opening up the Events List Item and I click on the 'Print to PDF' button on the Nintex Form that the Event item and any associated linked Incident Items and their photos would all show up on the PDF file that is created.

Note: I'm always amazed at the great feedback I get from the Nintex Community and greatly appreciate everyone who has taken time to respond  to my question!!

Thanks again and I'll provide an update as to whether this will work for me once I give it a try.

Frank Cheney

Badge +7

Me neither. I still don't really get why this is actually happening.

Badge +3

I marked Henning's answer as correct as I followed the procedure that was provided and when opening up the Nintex Form for the 1st List Item that is Linked to the 2nd List Item I saw both list items on the Nintex Form as well as the columns that had photos inserted. I then did the 'Print to PDF' and it worked like a charm.

One other challenge I need to determine is how I can autosize/crop photos etc so they aren't huge in size. Anyone have any ideas on that challenge?

Thanks again for the help!

Frank Cheney

Userlevel 7
Badge +17

Awesome! SharePoint provides image renditions that it can apply to images automatically. I use them all the time for page content and in display templates.

Reply