Using Crystal Reports to put Data Back into a Database


Question: What if I want to take the data from a Crystal Report and dump it back into a database for further analysis without involving a DBA to do this for me?

Solution: You can easily do this by choosing the ODBC export option (this is an option only available if installed with Crystal Reports).

When you export to ODBC, all of the fields on the report are automatically put into a table ( you choose the name of your table ) in an ODBC database of your choice.

This is a good way to easily capture data that changes often for future auditing purposes without having to write complicated scripts, etc., on the database server.

Steps for an ODBC Export:
  1. Before getting started, make sure you have the ODBC for the database you want to export the report’s data to, set up on your machine.

  2. Open the report you want to export. In this example, we will use the Sample Report, in the Feature Examples folder, called Accessibility.



  3. Go to the File menu and select Export>Export Report



  4. In the Format drop-down menu select ODBC.



  5. Click the OK button.

  6. Select the DSN name you want to export the report’s data to. In this example, choose Xtreme Sample Database 11.5



  7. Now it should prompt for a table name. Enter Accessibility and the current date. If you are going to do multiple exports you cannot export to the same table, the table name must change.



  8. Click the OK button.

  9. The screen should show an Exporting Records screen.



  10. Open the Xtreme Sample Database in Access and verify the table exists:



  11. Open the table and view that all the fields are contained in the table, along with the export date and time.



A couple of things to keep in mind:
  1. You cannot export to the same table, you must re-name the table for every export.

  2. This export option is not available in Enterprise, therefore, you would have to build your own custom application to automate this process.


© 2010 InfoSol® Inc. All Rights Reserved

Legal