If your business is successful, it won't take too long for you to have plenty of customers -- and lots of data about them. How do you keep track of it all? With a customer relationship management system, of course. This article will explain how to use the open source SugarCRM to produce an appropriate report. It is excerpted from chapter 8 of the book Practical Reporting with Ruby and Rails, written by David Berube (Apress; ISBN: ISBN: 1590599330).
Creating Sales Performance Reports with SugarCRM (Page 1 of 6 )
According to Peter Drucker, the famous management consultant, "the purpose of business is to create a customer." The way to create customers is with sales, and when you have a large and active sales force, your salespeople will generate a huge, and often intimidating, amount of customer data. Systems that manage customer data are called customer relationship management (CRM) systems. An excellent choice is an open source product called SugarCRM (http://www.sugarcrm.com/), which is freely available for download and use but also offers paid technical support services.
The example in this chapter demonstrates how to produce a sales performance report with SugarCRM, as well as how to use two open source utilities--html2ps and Ghostscript--to create PDFs from HTML documents.
To run the examples in this chapter, you'll need to install SugarCRM. You can download SugarCRM from the following site:
At the download site, you'll find two types of installers: the first includes just the SugarCRM source code, which is ideal if you've already installed the Apache/MySQL/PHP stack. If not, installers that combine all of the required components (along with SugarCRM, of course) are available for Linux, Mac OS X, and Windows. Choose the appropriate installer for your system.
After you've downloaded the SugarCRM installer, follow the installation instructions to install SugarCRM. You can download the instructions from this site:
The installer also adds sample data, which you'll use in this chapter's example. Of course, if you already have a SugarCRM database, you can use that data instead.
Sales Force Reporting
Let's suppose your boss has experienced productivity problems with the sales force. In an effort to boost output, he wants to reward productive employees with a gift based on their number of meetings with clients and potential clients. The more meetings a salesperson has, the better the gift.
He would like to keep tabs on this effort, and wants you to produce a report that lists each salesperson and the gift that person has earned. Your boss wants the report to be made available in a format that is easy to print and e-mail. Therefore, you've decided to create the report as a PDF file.
Fortunately, it should be fairly easy to create a Ruby report that pulls this data from the SugarCRM database. First, though, you'll need to modify the database to include the extra gift information.