Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

13.06 Secured Databases

Secured Databases

Most databases have security implemented in them. They require valid user credentials before accessing the data. This means that you have to pass a User Id and Password to the database prior to printing the report. Crystal Reports handles security differently, depending upon how the report is bound and the database used.

In most circumstances, a Windows application displays a login dialog box prompting the user to enter their user credentials. After entering the credentials, the user can login. However, this isn’t always the case. If you are using an MS Access database with a database password or if you are printing from an Excel spreadsheet using OLE DB, the login dialog box isn’t compatible. If you are writing an ASP.NET application, it doesn’t have the capability to prompt the user for their credentials. In both of these examples the user won’t be able to print the report. Rectifying this problem requires passing the user credentials during runtime. See Chapter 17 for a thorough discussion of connecting to every type of data source during runtime.

When using integrated security with ASP.NET applications, the SQL Server database should be on the same server as the web server. There are known issues when IIS tries to connect to SQL Server and then Crystal Reports tries to connect again. It can’t perform a “double-hop” and the connection fails. See Microsoft Knowledge Base article 176377 for more information.