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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass DB logon info to Crystal Report Control? 1

Status
Not open for further replies.

CraigBest

Programmer
Aug 1, 2001
545
US
OK one more question about using the Crystal Report Viewer control:

I am currently giving my viewer control a report file name using the .ReportSource property of the control. What's happening is that I'm being prompted for Database Logon info (DB Name, UserID, Pwd). I would like to pass these parameters to the report from the control. What is the property I need to address in order to pass this information?

Thanks


CraigHartz
 
OK, I managed to successfully upgrade to VS.NET 2005. I tried the code you guys put up, the Framework 2.0 code that Shelton posted worked the best (but I had to remove the For... Next loop in order to make it work (I have only one connection anyway) and that worked without an issue. ThatRickGuy's code brought up a data cast error, and using the For... Next loops I was getting index out of range errors.

I'm still having issues with the report not opening but I'm not sure that's related to this. After the code executes I get prompted for the password (I assume that should not happen because I'm passing it with the rest of the DB info) and then it says the report could not be opened.

But thanks so far for all of your help, at least it finally got me to go ahead and run the upgrade. BTW, will it damage the 2005 installation if I uninstall the 2002 installation?


CraigHartz
 
Sorry bout that Craig, I had cr defined outside of the scope that I grabed that code from. It should be defined as:
Code:
Private cr As CrystalDecisions.CrystalReports.Engine.ReportDocument

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Uninstalling the 2002 stuff shouldn't impact on the 2005 version, but unless you are really struggling for disk space it may be prudent to just leave it.
 
Yeah, space isn't really an issue. I guess I'll leave it. Thanks.


CraigHartz
 
OK, success finally! As I suspected part of my problem was using the wrong Server and DB information when trying to open the report. Now that I have the correct info (and have upgraded to VS 2005) the code is working -- What I ended up with is closest to Shelton's corrected example.

Thank you all very much for all of your help, I really appreciate your patience while I worked through this.


CraigHartz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top