Example | Creating a report from multiple lists
Applies to JungleDocs for Office 365.
For a similar tutorial for JungleDocs for SharePoint 2010-2019, click here.
In this example case, you will learn how to create a quick report of the selected company's contacts with JungleDocs for Office 365. You will do this by automatically exporting SharePoint list item metadata into a Word document.
What we want to achieve
In this example case, we want to get an overview of our client companies and the individual contacts we have for each of them. We have the companies and clients stored in two separate lists.
Firstly, we want to export the below list to Word.
Secondly, we want to export the contacts from the list below, in such a way that they will appear under the correct company.
Once we have achieved this, we will have a good overview of companies and their employees.
Step 1: create a Report rule
To start we will have to create a Report rule:
1. From the Companies list, open JungleDocs 365 from the ribbon.
2. On the Reports tab, click New rule.
3. Name your rule and choose what you want to happen after you run the rule (document gets downloaded or is saved to a SharePoint library).
4. To help you with the template creation, click Generate sample document. This command will create a document with content controls that you can drag into your template.
5. You can now save the Report rule. We will come back to it after creating the template.
Step 2: create a document template
1. Insert static content
Now we will create a template for our company report. First, we insert static content. Static content is content that is always there and does not change. For the static content in this template, we will just add our logo to the header.
2. Insert content controls
We will now insert content controls to let JungleDocs for Office 365 know what spaces should be filled with metadata from the Office 365 environment.
1. With the document opened, go to the Developer tab and insert a Rich Text content control.
2. Once you have inserted the content control, click Properties and enter the ReportItems formula in both the Title and Tag fields. Adding multiple lines inside the content control will give you more space to work for the next couple of steps.
3. Next, you will add the content controls within the ReportItems field for all of the column data you want to be exported to the Word file. You can do this simply by dragging and dropping the content controls from the sample document you created during step 1.
5. After you have dragged the content controls from the sample document into the ReportItems field in the new template, your template will look like this:
6. Now you can add a table below the existing content controls. This table will be populated with the contact details. Once you have created the table and decided in which column you want what data to appear, you select the entire bottom row and insert the GetView content control to gather data from the Contacts list.
7. The GetView formula, in this case, looks like this: Getview ("Contacts"; "All Items"; "Company"; Title) . The Contacts refers to the list from which we want to gather our contacts; All Items is the name of the view we are using; and we are filtering the view by Company because we want the right contacts to show for each company:
8. Once you have finished editing your template you can save it and move on to the next step.
Step 3: create a Report rule
Now go to the document library where you want your documents to be stored and open JungleDocs 365 from the ribbon.
1. Navigate to the Reports tab in JungleDocs 365.
2. To add a Report rule click New rule.
3. A new window will now open, prompting you to configure the new Report rule. S elect the name, target location, template, naming automation etc.
4. Select the template you created for this rule.
Note: it is our recommendation to store all your templates in a separate template library on your SharePoint Online environment. This will make it easier to manage your templates and you can be sure they won't be deleted by accident if a certain project gets deleted.
5. Once you have configured your new Report rule, click Save to save it. You are now done and can select the new rule from the Reports tab in JungleDocs for Office 365.