In Crystal 9.0 this is done by selecting from the menu on top Database->Select your ODBC datasource that you set up->Add Command. The syntax is exactly the same as if you were calling the stored procedure using psql with the exception of formatting of any parameters you are passing to the stored procedure. The only specify the data fields is to manually enter the SQL statement into the Crystal report. In order to report against a stored procedure you must be able to tell Crystal what data fields and their types it can expect to receive from the stored procedure. Reporting against stored procedures in PostgreSQL is much different than what I had experienced with other databases. This is the real reason I wrote this mini howto. Reporting against stored procedures Without parameters An example of this is the following: CREATE OR REPLACE VIEW myschema.view_intercultural AS SELECT d.client_name, 'Intercultural Overall'::bpchar AS question FROM myschema.international d Don't use ::text in place of ::bpchar in the above example, otherwise Crystal will not let you choose the column for grouping. When creating Views however I recommend that you specify a data type for the column name to ensure that Crystal will be able to read the column name if you are renaming a column or assigning a name to a column. There is nothing special you need to know or any special tricks when reporting against views. Reporting against views is the way most reports against Crystal will be done. You can add multiple tables and link them in Crystal as with any other database. If you must report against a table in a schema other than the public schema create a view against the table and report off of that view. If the table(s) are not a member of the public schema and you try to add them to your report Crystal will give you an error message(Not supported). Tables can be added to Crystal Reports using the database expert like any other database BUT must be a member of the public schema. Reporting against tables can be done with cavets.
If you cannot connect to the database please contact your admin or read the PostgreSQL documentation to check your database settings.
Access to a PostgreSQL database is of course required. This document was written using PostgreSQL 7.X as the database version.There is a bug in Crystal 9.0 with how Crystal interprets some database column names because of the data type that PostgreSQL uses.
Prior versions of Crystal should support reporting against a PostgreSQL datasource with the exception of stored procedures.
This document was written using Crystal Reports 9.0 Professional as the development tool. I hope this document will help others who must use a Crystal Reports and PostgreSQL combination. When I began reporting against a PostgreSQL database I ran into some quirks that were difficult to find solutions for. Until recently I had used it to report against Microsoft Access, Microsoft Outlook, Microsoft SQL Server, and Sybase databases. I started using Crystal Reports around release 7.