Print Page | Close Window

Problems with CR & ODBC

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4665
Printed Date: 04 May 2024 at 7:07am


Topic: Problems with CR & ODBC
Posted By: Duke_Quakem
Subject: Problems with CR & ODBC
Date Posted: 29 Oct 2008 at 2:34pm
First of all, I want to say hello to y'all. tryin' to find a solution to my problem I got here...

I have a website created using VS2005 C# and Crystal Report 10 that comes with it. The reports are using a DNS connection string ("DSN=myDsn;UID=myUser;PWD=myPass") that works perfectly in the deployment computer.

Also, If I put the site on the server, If I use the Server's IE the report comes out without any trouble.

But, when I try to see the report from another computer, I get this login screen that ask me the user & password, even if I had set them earlier in the Conn string... (the img shows what screen I get)Cry

http://img233.imageshack.us/img233/5743/crgx5.jpg

I don't know if that cause some security issues that can be fixed unisg web.config, or is it cause I'm missing something in the CR? I have tried to force the connection by code, but I can't figure how to do that.

Thx in advance 4 ur help



Replies:
Posted By: BrianBischof
Date Posted: 29 Oct 2008 at 11:28pm
My initial idea is that the impersonation account for your website isn't an authorized user for SQL. Possibly there is a firewall security where someone on an outside IP can't query the database? I think it's definitely a security problem, but I can't say what part is breaking down.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: Duke_Quakem
Date Posted: 30 Oct 2008 at 5:46am
In the website I use the same ODBC to populate some Gridviews and insert/update data into the DB (wich is Oracle. I forgot to tell that on my last post), and those forms works perfectly, so I'm pretty sure it's not the account's privilieges.

It seems CR does not allow to remote computers access thruought the ODBC into the DB, because as I said earlier, when I use the Server's borwsers (FF and IE), the report shows fine. The problem is when I try to see the report using the browser from another computer that is not the server itself, that's when I get that screen.

So far I tried to load the CR adding these lines in the .cs file:

protected void Page_Load(object sender, EventArgs e)
{
    doc.Load(Server.MapPath("report.rpt"));
    doc.SetDatabaseLogon("user","password","databaseName.world","",true);      
    CrystalReportViewer1.ReportSource = doc;
    CrystalReportViewer1.DataBind();
}

Getting the same issue. Later I tried using a .dns file and with that I can override the problem and the report shows on all browsers (server and clients) without getting that annoying screen. So I'm thinking in use that option.

Now, the new (darned) problem I have is that on development enviroment (the local server I use to test the sites I made) the website is in one direction (C:/Inetpub/wwwroot/website), but on it's final destination the website will be allocated in another path (D:/wwwprod/website). ¿Do you know if there is a way to set the .dns file path dinamically by code?





Print Page | Close Window