You must Sign In to post a response.
  • Category: Visual Studio

    Database Login Failed In SAP Crystal Reports in VB.NET 2010

    Hi !
    I am working in a project using vb.net 2010 with SAP Crystal Reports.
    Regarding the Reports everything is fine but i had an unusual problem.
    Actually i have to make a report using sub report technique but when i call the main report that calls another sub report then Crystal Reports gives an error "Database Login Failed"

    I show the code for both Master and sub report below.

    "Code for Sub Report"

    MyDataAdapter = New SqlDataAdapter("Select * From tbl_view_JC_SUP", SQL_CONNECTION)
    MyDataAdapter.TableMappings.Add(0, "tbl_view_JC_SUP")
    MyDataSet = New DataSet
    MyDataAdapter.Fill(MyDataSet)
    MyDataSet.Tables(0).TableName = "tbl_view_JC_SUP"
    Dim MyCrystalReport As New rpt_CCC_JobCard_Sup
    MyCrystalReport.SetDataSource(MyDataSet)

    "Now Code for the Master Report"

    MyDataAdapter = New SqlDataAdapter("Select * From tbl_view_JC_Master", SQL_CONNECTION)
    MyDataAdapter.TableMappings.Add(0, "tbl_view_JC_Master")
    MyDataSet = New DataSet
    MyDataAdapter.Fill(MyDataSet)
    MyDataSet.Tables(0).TableName = "tbl_view_JC_Master"
    Dim MyCrystalReport As New rpt_CCC_JobCard
    MyCrystalReport.SetDataSource(MyDataSet)
    frm_r_ReportScreen.crvReportViewer.ReportSource = MyCrystalReport
    frm_r_ReportScreen.Show()

    Note:
    "rpt_CCC_JobCard_Sup" and "rpt_CCC_JobCard" are the crystal reports.
    rpt_CCC_JobCard_Sup is the sub report of rpt_CCC_JobCard
    when i call the master report then crystal reports error comes "Database Login Failed"
    can anyone help me?
    i am very worried !

    thanks !
  • #756305
    The data source you are providing may not be passed on to the sub report, please make sure you have correct data source selected for the subreport as well.

    Use the RDL file to configure this section.

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM


  • Sign In to post your comments