How to display the database the report is based off?
Is there a special function in Crystal Reports that will display the database name?
How to print on the report, the name of the database the report is using in Crystal Reports?
SAP Crystal Reports 2008
- SAP Crystal Reports 2011
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
There is no function, or special fields in Crystal Reports that will display the name of the database the report is based off.
- A potential suggestion, will be to contact your database administrator, or look in the database documentation, and verify if there is a specific SQL function that can be used for your database to retreive the database name. If there is, and you have the necessary rights on the database, it might be possible to add the specific SQL Function of your database in a SQL Expression Field. Which you can then add on your report to display the database name.
For MS SQL Server, the function: DB_NAME() returns the name of the Database the user is connecting to. To add the database name on the report for MS SQL Server:
- In Crystal Reports, open the report based off a MS SQL Server database, on which you want to display the database name.
- In the Field Explorer pane, right click on "SQL Expression Field", and select "New..."
- Type a name for the SQL Expression Field, and click "OK"
- In the SQL Expression Field window, type: DB_NAME()
- Save and close the SQL Expression Field.
- Add the SQL Expression Field on the report to display the database name.
CR, db name , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To
Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016