Login / Register  search  syndication  about

          George Jensen's Blog

George Jensen on Reporting, Business Intelligence, Crystal Reports, Visual Analyzer, and more.

Using Microsoft Excel as a delivery method for reporting

There are many ways to get your data into a Microsoft Excel spread sheet for reporting purposes. Business Objects Crystal and Sage SalesLogix both offer an option to kick out report data to an Excel spread sheet.  Last week I worked with a client who wanted exactly that, a set of data exported to Excel so the users could manipulate it as they needed.  She came to me under the assumption that this could only be done through Crystal.  Now the benefit for going through Crystal is the parameters established in the report are honored.   But it is possible to export your data from the SalesLogix database directly into Excel and with a little help from SQL Views you are able to filter and organize your data for the export.  The best part is the data is able to be refreshed as often as required in excel and the users do not need to be in SalesLogix to run the report.

The first step in this process was to think about all of the data you would like to see in the final export.  In this instance my client had several version of the sheet she wanted to produce so the first set of views brought all of the data together that could be used in any of the Excel files, we did this without using any filters.  This  allowed her to then customize additional SQL views to support each version of the file she wanted.   Creating the views was really the toughest part, we ended up rewriting our views a couple of times to support additional fields requested after user testing of a sample file.  So I encourage you to really plan things out with your end users before sitting down to write the SQL views, hopefully planning up front will result in less overall work effort.

For our example today we will use a view I created for the Crystal Report writing class.  This view is a Contact based and provides the number of History, Activity, Opportunities, and Tickets related to each Contact in your system.  This view is nothing Fancy but will help prove our point.

Create View sysdba.VContactCounts

as

SELECT LastName, FirstName,

(SELECT COUNT(HISTORYID) AS Expr1 FROM sysdba.HISTORY WHERE (CONTACTID = c.CONTACTID)) AS HistoryCount,

(SELECT COUNT(ACTIVITYID) AS Expr1 FROM sysdba.ACTIVITY WHERE (CONTACTID = c.CONTACTID)) AS ActivityCount,

(SELECT COUNT(OPPORTUNITYID) AS Expr1 FROM sysdba.OPPORTUNITY_CONTACT WHERE (CONTACTID = c.CONTACTID)) AS OpportunityCount,

(SELECT COUNT(TICKETID) AS Expr1 FROM sysdba.TICKET WHERE (CONTACTID = c.CONTACTID)) AS TicketCount

FROM sysdba.CONTACT AS c

GROUP BY ContactID,LastName, FirstName

Once your view is giving you the data the way you want to see it the easy stuff begins.  I am working with MS Office 2003 so please forgive me MS Office 2007 people.  The client I worked with had Office 2007 so this will work there also,  If I get access to a 2007 machine I will post the steps for you.

The items required to be successful at this are the name of your SQL server, the sysdba password for SQL Server.  The name of your SalesLogix database and of course the name of your SQL view.  

Open a new MS Office Excel file.   

Select the  Data>Import External Data>Import Data menu item

The following screen will appear:

Here we are going to select New SQL Server Connection which brings up the following screen.

This is where you list out the SQL Server Name and sysdba password.  On selection of the "Next" button the following screen appears:

Here we select the database name and then search for the SQL View.  This is a little tricky, the views are listed here first then tables.

You see here the check box for Save Password.  If you do not want the users to have access to this sysdba password then I suggest setting this to true.  They will have access only to the data released via this connection.

On this screen you see the cell where the export will start building the export.  You can click on the appropriate cell in the back ground to reset. Then click Finish and the export should run immediately.  IF there are more then one views providing you the data this process can take a few seconds. Moving forward, all the users has to do is hit the  button, or Data Refresh Menu Item to update the file

Now the data is in excel you can do anything you want with it to include sorting or building formulas or graphs.   

FYI, I played around with other methods of creating the connection to the database but this was the most straight forward. If I discover a better method I will update this post.

Hope this helps someone.  Thanks for reading. Geo

 

What's This?
Bookmark and Share

About George Jensen

   George Jensen is a Senior Developer for Customer FX Corporation.


Related Content
   Looking at Stonefield Query for Sage SalesLogix (Part 5)
Sorry for the long absence, I went away on some training with the Minnesota National Guard.  This is
Posted on Sep 01, 2010 by George Jensen to George Jensen's Blog
 
   Picklist Column types - Dispaying ticket status in the SalesLogix LAN datagrid
I recently had to build a datagrid displaying ticket information, including the current Status value. Un
Posted on Aug 24, 2010 by Jason Buss to Jason Buss' Blog
 
   SalesLogix Cloud- Administration Options- Using Roles
In this webinar the user will learn to manage roles in the SalesLogix Web Client. These options are onl
Posted on Aug 20, 2010 by Dale Richter to Free SalesLogix Training
 
   SalesLogix 7.5.2 Speed Issues - How To Find the Slowdown
At times I have been asked how can I increase the performance of SalesLogix. For systems using SQL2005
Posted on Aug 13, 2010 by Mark Duthoy to SalesLogix Support
 
   SalesLogix Cloud- Administration Options- Creating a New Team
This Administrative webinar will show the user how to create a new Team for ownership of records. This is
Posted on Aug 13, 2010 by Dale Richter to Free SalesLogix Training
 
Comments

 

michaelorivera said:

Wow works great!

What if you have more than one view?  I have a Crystal Report with 4 views that I want in Excel.  How would I go about doing that?

Thanks ahead of time,

Michael.

April 19, 2010 2:57 PM

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2010 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register