Pages

Friday, November 25, 2011

Working with the Stacked Bar Graphs in Sage SalesLogix Crystal Reporting

Todays blog post focuses on Crystal Reports stacked bar chart. This chart allows you to use Subgroup totals to make up the group/bar total. This chart is good for showing comparisons between group and subgroup values. The best way to show you this bar chart is to create a quick report using the SalesLogix History table.  You will also need the Picklist table joined to the History table using the HISTORY.TYPE to PICKLIST.ID fields.  I then inserted two fields into the details section of my report, the HISTORY.COMPLETEDDATE and the PICKLIST.TEXT.
Since there are many types of History records I decided it would be best if I limit my report data.  I inserted the following in the Record Selection Formula Editor launched from the Report > Selection Formulas > Record menu items. 
Year({HISTORY.COMPLETEDDATE}) > 2005
and
{PICKLIST.TEXT} in ["E-Mail", "To-DO", "Phone Call", "Meeting"]

This will give me a comparison for this year based on the data from the last four years and limit the type of records to just E-Mails, To-Do's, Phone Calls, Meetings.
Finally we need some the groups and the summary data.  For Group1 I will us the HISTORY.COMPLETEDDATE grouped by year and Group 2 use the PICKLIST.TEXT sorted ascending.  Add a summary to the group 2 footer that provides the count of each type of our selected history records.  This is what my report looks like at this time with the details section suppressed:

In point of view this is the deal, you have the data you need to get your point across but for some reason people seem to really like the eye candy.  So let's get this data into the stacked bar chart. 
So what I did first is suppress all of the sections of my report except the report footer.  I then right clicked on the white space in the report footer and selected Insert Chart from the list that appeared.  Immediately an orange square attached itself to my cursor and I clicked onto the center of the report footer white space, ta-da, a chart appeared.  Again this is the side by side bar chart, to convert to the stacked bar chart I right clicked on the chart and selected the Chart Expert.  When the chart expert opened I selected the chart type of Stacked Bar Chart. I also played around with the values on the text tab to make the report headers make sense.  When you select OK this is the chart you will get.

To add the total for each sub group you can right click on the chart again but this time select the Chart Options from the list.  You will find a tab called Data Labels that will allow you to display the total of each sub group and the total of all records for each year. 

What I really like about this chart is that you can arrange the labels off to the side if they are overlapping each other as you can see I did for the 2010 column of data.  Again Crystal makes it real easy to get your SalesLogix reports looking smart.  Hey, next we will work with the Percentage Bar Chart. Until then, thanks for reading this blog, take care, and keep smiling

No comments:

Post a Comment