Problem with reports
I have a problem
I created
Vb.net project 2015 with sql
After I cleared the project and tried the project at the client
An error appears when the reports are shown by the crystal Report
Code:
Dim rpt As New WaznRep
For Each DSC As CrystalDecisions.Shared.IConnectionInfo In rpt.DataSourceConnections
(DSC.SetLogon(muser, mpass)
DSC.SetConnection(mserver, mdb, False)
Next
ReportV1.CrystalReportViewer1.ReportSource = rpt
ReportV1.ShowDialog()
It does not connect to the database
This message appears and the name of the database is empty
But from my device everything works
And I used the last code to connect to the database
Code:
Dim rpt1 As New WaznRep
Dim ConInfo As New CrystalDecisions.Shared.TableLogOnInfo
ConInfo.ConnectionInfo.ServerName = mserver
ConInfo.ConnectionInfo.DatabaseName = mdb
ConInfo.ConnectionInfo.UserID = muser
ConInfo.ConnectionInfo.Password = mpass
rpt1.Database.Tables(0).ApplyLogOnInfo(ConInfo)
ReportV1.CrystalReportViewer1.ReportSource = rpt1
ReportV1.CrystalReportViewer1.RefreshReport()
ReportV1.ShowDialog()