Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP.NET 2.0 Crystal Reports Issue with MySQL DB

ASP.NET 2.0 Crystal Reports Issue with MySQL DB

Scheduled Pinned Locked Moved ASP.NET
helpdatabasecsharpasp-netmysql
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DigiOz Multimedia
    wrote on last edited by
    #1

    Hi 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: [CODE] Dim cnString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=servername;DATABASE=dbname;UID=user name;PASSWORD=password;OPTION=3" Dim cn As New OdbcConnection(cnString) cn.Open() Dim MyReport As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent MyReport.Load("C:\Inetpub\wwwroot\Report1.rpt") MyReport.SetDataSource(cnString) MyReport.SetDatabaseLogon("username", "password") MyReport.SetParameterValue("parameter1", "1001") CrystalReportViewer1.ReportSource = MyReport CrystalReportViewer1.DataBind() cn.Close() [/CODE] 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: [CODE] Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports System.IO Imports MySql.Data.MySqlClient ' Class Name etc here ... Dim conn As New MySqlConnection conn = New MySqlConnection("Server=servername; Database=dbname; User ID=dbuser; Password=dbpass; charset=utf8;") conn.Open() Dim MyReport As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent MyReport.Load("C:\Inetpub\wwwroot\Report1.rpt") MyReport.SetDataSource("Server=servername; Database=dbname; User ID=dbuser; Password=dbpass; charset=utf8;") MyReport.SetParameterValue("parameter1", "1001") CrystalReportViewer1.ReportSource = MyReport CrystalReportViewer1.DataBind() [/CODE] But so far no luck. Does anyone know what the problem is with it? Any help would be appreciated. Thank You

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups