Click here to Skip to main content
15,038,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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"

VB
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"

VB
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 !
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900