943,101 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 13612
  • ASP.NET RSS
Sep 23rd, 2006
0

ASP.NET Crystal Report ODBC MySQL

Expand Post »
I am trying to display a Crystal Report developed using MySQL database and ASP.NET 2.0 (VS.NET 2005), and for some reason when I pass the database login information to the report it does not accept them (still shows a db login screen). Here is the code:

ASP.NET Syntax (Toggle Plain Text)
  1.  
  2. Dim cnString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=servername;DATABASE=dbname;UID=user name;PASSWORD=password;OPTION=3"
  3. Dim cn As New OdbcConnection(cnString)
  4. cn.Open()
  5. Dim MyReport As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent
  6. MyReport.Load("C:\Inetpub\wwwroot\Report1.rpt")
  7. MyReport.SetDataSource(cnString)
  8. MyReport.SetDatabaseLogon("username", "password")
  9. MyReport.SetParameterValue("parameter1", "1001")
  10. CrystalReportViewer1.ReportSource = MyReport
  11. CrystalReportViewer1.DataBind()
  12. cn.Close()

I have one Crystal Report Viewer and one Crystal Report Source objects on the form. The Crystal Report Source is set to "Report1.rpt" and the Viewer's source is set to that as well. When I run it, I get a parameter field request followed by a server login information request.

The actual Report properties are:

Database DLL: crdb_odbc.dll
DSN: NameOfDSNSource
UseDSNProperties: False
UserID: databaseUserName

I have even tried this:

ASP.NET Syntax (Toggle Plain Text)
  1. Imports CrystalDecisions.CrystalReports.Engine
  2. Imports CrystalDecisions.Shared
  3. Imports System.IO
  4. Imports MySql.Data.MySqlClient
  5.  
  6. ' Class Name etc here ...
  7.  
  8. Dim conn As New MySqlConnection
  9.  
  10. conn = New MySqlConnection("Server=servername; Database=dbname; User ID=dbuser; Password=dbpass; charset=utf8;")
  11. conn.Open()
  12. Dim MyReport As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent
  13. MyReport.Load("C:\Inetpub\wwwroot\Report1.rpt")
  14. MyReport.SetDataSource("Server=servername; Database=dbname; User ID=dbuser; Password=dbpass; charset=utf8;")
  15. MyReport.SetParameterValue("parameter1", "1001")
  16. CrystalReportViewer1.ReportSource = MyReport
  17. CrystalReportViewer1.DataBind()
  18.  

But so far no luck. Does anyone know what the problem is with it? Any help would be appreciated.

Thank You
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
digioz is offline Offline
11 posts
since May 2005
Mar 1st, 2007
0

Re: ASP.NET Crystal Report ODBC MySQL

Have you tried just passing the database login for the crystal report?

Try this guide and see if it helps:

http://www.instantcrystal.net/instantguide.aspx
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jeni73 is offline Offline
1 posts
since Mar 2007
Mar 2nd, 2007
0

Re: ASP.NET Crystal Report ODBC MySQL

Click to Expand / Collapse  Quote originally posted by jeni73 ...
Have you tried just passing the database login for the crystal report?

Try this guide and see if it helps:

http://www.instantcrystal.net/instantguide.aspx
Thank you. I actually did solve my problem a few month ago. The only thing I was doing wrong was I was trying to pass the database login information to the report, while setting the wizard that comes with the Crystal Report Viewer at the same time! I took out the information in the wizard and it worked like a charm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
digioz is offline Offline
11 posts
since May 2005
Apr 4th, 2011
0
Re: ASP.NET Crystal Report ODBC MySQL
so what actually your problem? I have same problem that gives me login screen when i tried to show the report. Please tell me..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
anli_chandra is offline Offline
2 posts
since Apr 2011
Apr 4th, 2011
0
Re: ASP.NET Crystal Report ODBC MySQL
Hello Anli. As I said in the previous post:

Quote ...
The only thing I was doing wrong was I was trying to pass the database login information to the report, while setting the wizard that comes with the Crystal Report Viewer at the same time! I took out the information in the wizard and it worked like a charm.
By the way, I posted this thread in 2006, so it's been about 5 years since I actually had this problem.

Pete
Reputation Points: 10
Solved Threads: 0
Newbie Poster
digioz is offline Offline
11 posts
since May 2005
Apr 5th, 2011
0
Re: ASP.NET Crystal Report ODBC MySQL
Oh, thank you for your reply. I have found the solution. Just because i wrong write my DSN ODBC for MySQL. Once again thank you very much.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
anli_chandra is offline Offline
2 posts
since Apr 2011

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: How to change div layout?
Next Thread in ASP.NET Forum Timeline: ASP.net ajax





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC