Problem connecting to Crystal Reports 9 database

Crystal Reports 9 seems to store database connection information inside the report file itself. I have a problem with this connection. I work with a development team, all of which have their own copy of the database on the same server. We use Trusted Connections for db. When we need to make changes to the crystal report, and we click the lightning to execute the report, Crystal does not request registration information in the database. In fact, it ends up connecting to the last database that was used when the report was last saved.

We came up with 2 workarounds:

  • Take a database in which the crystal thinks it should connect offline, and then the crystal will ask for login information.
  • Remove permissions for username making crystal change.

None of them are suitable for us. Does anyone know how to remove a crystal connection from a report file?

We tried Logat Datasource Location and all the settings in Expert Expert.

UPDATE

I still haven't found a solution that fits my case. But our newest solution is to download the crystal report, and before you press the lightning (to run the report against the database), disconnect the Ethernet cable. Then, when Crystal cannot find the database, reconnect the Ethernet cable and you can choose a different server and database name.

+4
source share
5 answers

You can use the .dsn datasource data file in a user-defined location (i.e., the same path for each user but a different physical location) and point to Crystal Reports. For example, on each drive C: C: \ DSNs \ db.dsn or on a network drive that appears elsewhere for each user.

You can get more information about .dsn files on MSDN: http://msdn.microsoft.com/en-us/library/ms710900(VS.85).aspx

+1
source

We use this method (using SQL authentication):

  • open report
  • database - server log
  • database - setting the data source
  • Update / Preview

You can disable access to the domain [domain user] to the dev database, should also help :)

+1
source

I’m probably too late for a chance to be generous, but I’ll give an answer anyway.

If you use Crystal Report directly or using Crystal Enterprise, then the only way I can do this is to use dsn as references to paulmorriss. The disadvantage of this is that you will use ODBC, which, in my opinion, is generally slower and considered obsolete.

If you use this in an application, you can simply change the database connection settings in code. Then everyone can develop a report against their own test database, and you can point it to the production database at run time (provided that the developers database is updated and contains the same fields as the production database).

To do this, you must use the following function:

private void SetDBLogonForReport(CrystalDecisions.Shared.ConnectionInfo connectionInfo, CrystalDecisions.CrystalReports.Engine.ReportDocument reportDocument) { CrystalDecisions.CrystalReports.Engine.Tables tables = reportDocument.Database.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables) { CrystalDecisions.Shared.TableLogOnInfo tableLogonInfo = table.LogOnInfo; tableLogonInfo.ConnectionInfo = connectionInfo; table.ApplyLogOnInfo(tableLogonInfo); } } 

To do this, you need to pass a ConnectionInfo object (which will contain all your registration information) and a report document to which it will be applied. Hope this helps.

EDIT . Another option that I can't believe that I still haven't thought about is that if you use SQL Server, you can make sure that all the development database names are the same, then use ".". or "(local)" for the server and integrated security so that each user has local information about the same connection. I think this is probably the best way to make the assumption that you can force all developers to use the same setting.

EDIT Again :) After reading some comments on the other answers, I think I may have misunderstood this question. There is no reason why I can think about why you can’t take steps in Arvo’s answer outside of the lack of rights to edit the report, but I assume that you could make other changes, so I doubt it is. I assumed that in order for the report to work for each developer, you did all these steps.

+1
source

You can set login at runtime. See This Question ...

How to change ODBC database connection to Crystal Reports at run time?

If you used ODBC, each developer could specify their DSN in the corresponding database. Essentially clicking a connection string in a DSN and from a crystal report.

0
source

Yes, I agree, Crystal Reports is a pain. I ran into the same problem in the applications I created and had to use it.

1- Turn off the server (inside the crystal, right-click the database and exit) 2- Click on the database and change the location of the database

If you are logged in and changed the location of the database, it does not seem to insert

0
source

Source: https://habr.com/ru/post/1285939/


All Articles