Kaz
Kaz

Reputation: 179

Crystal report - Running thru .NET

I created a crystal report using test a DB. I run the report using .NET ReportDocument class. Everything works fine until I connect to the test DB.

When same report is pointed to UAT DB (all required DB objects are available in UAT too), I am getting error. To fix this, I have to change the server name to UAT DB manually in the RPT file.

How to fix this?

Upvotes: 0

Views: 523

Answers (3)

Tundey
Tundey

Reputation: 2965

A solution is to create a system DSN (ODBC) for connecting to your target database. You can then switch the ODBC to whichever database you want (local,test,stage etc). Also, if you ensure an ODBC connection of the same name is available on all your servers, moving the report from dev->test->stage->production should be easy.

Upvotes: 1

John
John

Reputation: 16007

Isn't that how it's supposed to work? It has to know to what DB it's connecting?

Maybe I'm missing something but it sounds like you just needed to get the connection right.

Upvotes: 0

Jeremy Frey
Jeremy Frey

Reputation: 2405

Using push reports should solve your issue. You can set up the report to accept a strongly-typed ADO.NET Dataset, and supply that dataset at runtime.

Upvotes: 0

Related Questions