2
votes

I'm having some issues getting crystal reports working nicely with our applications. And i cannot seem to find any resources that answer my question.

Basically, we have a crystal report, designed in the crystal reports application with it's own datasource.

Now when i add this to VS and display it, i need to setup a connection on the PC using MYSQL ODBC Datasource configuration tool, however even with this datasource setup, the crystalreports viewer askes for a password, and even suppling the correct password will show a "login failed. please try again" error message.

Ideally what i would like to know, is

A) is it possible and if so how, can i setup the connection in VS2010 so that i wont need to go around using MYSQL ODBC Datasource configuration tool on every PC i deploy my application too.

B) why does this connection always fail, the credentials are correct (we've tested multiple times, and the report & connection function perfectly from within crystal reports)

Hopefully you guys can help me out, my google fu has failed me.

1

1 Answers

1
votes

If the Crystal Report allows for the username and password to the mySQL stored procedure to be passed to the report through the ReportViewer object, you have to use .NET code-behind to set the credentials via the:

ReportViewer.ServerReport.ReportServerCredentials

property of the ReportViewer instance.

Here's an example:

System.Net.NetworkCredential networkCredentials = 
          new System.Net.NetworkCredential("username", "password", "domain");

reportViewer.ServerReport.ReportServerCredentials = networkCredentials;