Automatically Converting Reports To PDF in SharePoint
May 2008
A recent Abel Solutions Tip of the Month profiled an engineering consulting company who was using SharePoint and InfoPath to streamline their report generation process. Implementing SharePoint allowed the company to realize their intended results - generating and approving more customer reports in less amount of time.
In the year that followed their SharePoint implementation, the company produced reports at record pace, a direct result of both changing market conditions and the improved delivery process. Anticipating an even busier season than the year before, the company saw a need to further improve their process as the new year approached.
The higher volume led to a new challenge - once reports were logged in SharePoint and ultimately approved, how could they be quickly delivered to their clients? Once an InfoPath report was approved, it still needed to be manually printed or converted to PDF format, and subsequently delivered to the clients via email, fax, or traditional mail.
Printing alone took three minutes on average per report. While three minutes out of a day seems relatively insignificant, 1000 reports per month quickly translates into 50 hours spent each month printing reports.
The answer was an extension to SharePoint to automatically turn completed reports into PDF files. With this custom-coded solution, every report that is approved by a project manager is automatically converted into a PDF file, stored in a SharePoint library, and tagged with the appropriate metadata.
The solution leverages a SharePoint capability called Event Receivers. An event receiver is a section of custom code that can be attached to a SharePoint list or library that responds to specific events, such as a document being submitted, edited, or deleted. The event receiver attached to the company's form library examines the submitted form, and checks to see if the form's status is Approved. If so, then the receiver automatically generates a PDF. The PDF file that is generated is based on a combination of the design of the form template, as well as the data submitted to the form. The event receiver then saves the file, using the SharePoint programming interface, into a SharePoint document library designated for PDF storage. The event receiver also applies the appropriate metadata fields to the PDF file based on the contents of the original InfoPath form.
The reports that require traditional mail and faxing still need to be printed, but having the PDF files immediately available reduces the time needed to print to less than one minute, resulting in monthly time savings of over 40 hours.
This extra utility helped close the loop for this company by filling the last remaining gap in their report delivery process. While 90% of their solution is based on core SharePoint capabilities, the other 10% is addressed effectively with a small amount of custom development.