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. Crystal Report - Database Logon Failed

Crystal Report - Database Logon Failed

Scheduled Pinned Locked Moved Web Development
databasesysadminxml
2 Posts 2 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.
  • N Offline
    N Offline
    N Surendra Prasad
    wrote on last edited by
    #1

    Hi, I have an XML file which is stored in a folder named XML and i have an RPT file (stored in CrystalReports folder) which has been designed by using this XML file as datasource. The report works fine in my local machine. But, when released in the server it is not working, it is giving the message like "Database logon failed". My Code behind, repDoc = New CrystalDecisions.CrystalReports.Engine.ReportDocument repDoc.Load(Server.MapPath("~/Reports/CrystalReport/MyReport.rpt"), CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) repDoc.SetDataSource(Server.MapPath("~/Reports/XML/MyXML.xml")) CrystalReportSource.Report.FileName = Server.MapPath("~/Reports/CrystalReport/MyReport.rpt") Do anyone know why it is not working. Regards N.Surendra Prasad ;)

    C 1 Reply Last reply
    0
    • N N Surendra Prasad

      Hi, I have an XML file which is stored in a folder named XML and i have an RPT file (stored in CrystalReports folder) which has been designed by using this XML file as datasource. The report works fine in my local machine. But, when released in the server it is not working, it is giving the message like "Database logon failed". My Code behind, repDoc = New CrystalDecisions.CrystalReports.Engine.ReportDocument repDoc.Load(Server.MapPath("~/Reports/CrystalReport/MyReport.rpt"), CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) repDoc.SetDataSource(Server.MapPath("~/Reports/XML/MyXML.xml")) CrystalReportSource.Report.FileName = Server.MapPath("~/Reports/CrystalReport/MyReport.rpt") Do anyone know why it is not working. Regards N.Surendra Prasad ;)

      C Offline
      C Offline
      cglaude2
      wrote on last edited by
      #2

      Hi I have the same problem. But I pass the crediential to the report at run time Code: Dim myFields As CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions Dim thisField As CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition Dim myValue As CrystalDecisions.Shared.ParameterDiscreteValue Dim my_Param_Name As String Dim my_Param_Kind As CrystalDecisions.Shared.ParameterValueKind Dim crCurrentValues As CrystalDecisions.Shared.ParameterValues Dim _report As New CrystalDecisions.CrystalReports.Engine.ReportDocument _report = New CrystalDecisions.CrystalReports.Engine.ReportDocument _report.Load(Server.MapPath("~/Report/Extraction_Event.rpt")) _report.SetDatabaseLogon("XXX_USER_NAME", "XXX_PASSWORD", "SERVERNAME", "DATABASENAME") myFields = _report.DataDefinition.ParameterFields For Each thisField In myFields myValue = New CrystalDecisions.Shared.ParameterDiscreteValue my_Param_Name = "_GUID" 'thisField.ParameterFieldName my_Param_Kind = thisField.ParameterValueKind myValue.Value = Session("_GUID").ToString '"" _DTParameter.Rows(i).Item(1) crCurrentValues = thisField.CurrentValues crCurrentValues.Add(myValue) thisField.ApplyCurrentValues(crCurrentValues) Next CrystalReportViewer1.EnableDatabaseLogonPrompt = False CrystalReportViewer1.ReportSource = _report End Sub

      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