Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Login Pops up

Status
Not open for further replies.

roccorocks

Programmer
Nov 26, 2002
248
US
I posted this in the CR 4 Other Topics forum also.

We are having an issue where we try to run a report on laptop, using C#.net (crystal reports within). The reports work fine on the developer machine. When the reports are ran on the laptop, that annoying database login window shows. We have included the required library and dependency files. Is there something else we are missing?

Thanks,

Rocco
 
How are you connecting to the database? you could have used a DSN on the dev machine but not created the DSN on the deployment machine, or you could have created the report with the DB sitting in C:\Documents And Settings\User\Visual Studio Projects\ProjectName\Somedb.mdb
and then when you deploy it is lookin for the db in the above folder...

My solution to this is when creating crystal reports, i use an ADO.NET DataSet and then when i load the report i load it from code, connect to the db, using the connection string in my app.config file, load the required data in to a dataset (with the same name as the one that the report was built against) and set the ReportDataSource of the report.
 
If the .rpt file is stored in the database as a blob then retrive it and save it on the disk.
Next, load the .rpt file,set database logon and the Report Source.
Code:
ReportDocument rd = new ReportDocument();
rd.SetDatabaseLogon("user","password");
rd.Load(@"c:\Reports\"myreport.rpt");
crViewer.ReportSource = rd;//crViewer is CrystalReportViewer;
obislavu
 
The information is pulled through web services, which populates a dataset. The dataset information populates the Report. The way the reports work, I dont believe have anything to do with our code (Same exact application and reports work fine on many other machines).

We have looked into the differences between a machine that works, and a machine that does not. On the surface, there do not seem to any differences. Could it be something in the registry? The machines are all up to date with windows updates. The .net framework is equivelant as well (service packs too).

Thanks,

Rocco
 
Extra note, reimaging seems to be the only fix thus far. Unfortunately, this requires too much of our Admin time.

Thanks,

Rocco
 
Finally, got this figured out. For those that are having the same problem, within VS.net 2003, you need to download the newest Merge Modules for VS.net 2003. They are located at :


They also have for other version of Crystal, as well as the full versions (VS.net is the bundled version).

Thanks,

Rocco
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top