We have recently enabled the email functionality for libraries. I am sure that there are much more advanced applications of this functionality in use by others, but I wanted to document our first attempt for others that may benefit.Our Situation: We use SQL Server Reporting Services (SSRS)to auto-produce a series of reports on a regular schedule. We wanted to have those reports be automatically uploaded into a SharePoint Document Library, then build a Web Part Page to automatically display the latest set of reports.Below are the steps we used to do this:
- Ensure that SharePoint’s journaling feature has been enabled.
- In SharePoint, create a Picture Library to store the report images.
- In SSRS, create and deploy the reports.
- Create email subscriptions in SSRS for each of the reports to be emailed to the new picture library with an attachment in PNG format.
- Set up the picture library with a category field. Specify category values for each of the unique report types coming into the library. In our case we have four unique report types and four corresponding categories.
- In order to preserve a history of the reports, we created a workflow to append the date to each report’s file name to make each file unique. We outlined this process in an earlier blog post: Change a Filename using a Workflow. Do not finish the workflow yet.
- In the workflow, add another step.
- Create a branch in the workflow for each category.
- Add a condition to “Compare <picture library> field” in each branch.
- Set the field to Title or Name, change Equal to Contains, and specify a keyword in the filename that identifies the category.
- Add an action to “Set Field in Current Item” to each of the branches.
- Set the field to your category field, and set the value accordingly for each branch.
- Click “Finish.”
We then created a Web Part page to display the images. We added the picture library web part to the page four times and made the following modifications to each one:
- In the drop-down for the web part, select Modify Web Part and make the following changes:
- Change the name to reflect the report being displayed.
- Click on “Edit the current view” and make the following changes:
- Uncheck the checked fields and check the Preview field.
- Order by the create date in descending order.
- Set a filter on the category field equal to the appropriate category.
- Change the Item Limit to 1.
- Click Ok.
The result will be a web part page that displays the last report uploaded in each of the categories.