Drupal Ubercart exporting orders in CSV or XLS (Excel Format)

Often times clients request a listing of detailed information from their Ubercart orders. Typically the standard Ubercart reports doesn't cut the mustard. Having reports in an exportable format like .xls or .csv allows easy importing into other applications. We'll cover how to create a table listing of your ubercart orders and how to export them.

This tutorial covers Drupal 6 modules. You'll need:

Ubercart http://drupal.org/project/ubercart
Views http://drupal.org/project/views
uc_views http://drupal.org/project/uc_views
Views Bonus Pack http://drupal.org/project/views_bonus

First, create a view for exporting. You'll have three different options with uc_views: Ubercart cart item (for items in customer carts), Ubercart order product (for products that have been ordered in the the store) and Ubercart order (for orders placed). Let's select Ubercart orders.

drupal ubercart views

Select your required filters and sort order. Perhaps you have categories you want to list or products with certain attributes. I have my view sorted by last name.

drupal ubercart xls

Next select your desired fields. My client wanted a listing of all the names, SKUs, and items purchased (including order total).

ubercart views export

Create a feed display. Then under Style select XLS file.

ubercart drupal excel

Then give it a file name.

ubercart drupal exporting view

Give it a path, then set the access to your clients' role. This is very important. If you do not configure the access correctly then potentially anyone could download this sensitive information.

drupal ubercart csv

Now you can add the link to your client's menu and they can download the XLS file.