When I try to open my CrystalReport on the Webserver I get this error;
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. SQL State: 08001 Native Error: Error in File C:\Windows\TEMP\cryVls1a33
{982C3F01-7159-47A6-B65C-771961E1F48A}.rpt: Unable to connect: incorrect log on parameters.
I set the connection string in the report and if got the connection info correct;
Dim ConnInfo As New ConnectionInfo
With ConnInfo
.ServerName = "##.###.##.#"
.DatabaseName = "***"
.UserID = "**********"
.Password = "********"
End With
Why does it work on my local host, but not on the Webserver?
This is not the problem with the Crystal Report, the problem lies with the connection to the server. Please check the configuration settings in the web config.
Also if you have been given the rights to access database etc.
If any file needs to be downloaded. This can give you some direction.
Please mark as an answer if it directs you to some what near to an answer. :)
I went another way with this and just added a button to extract the CrystalReport to a PDF file Instead of letting the Viewer handle it. Sometimes things done by hand are better than a package deal.
Here is my code:
Dim cmd
AsNew SqlCommand("sp_Report_BoardMeeting_Snapshot",
con)
Dim DateSelected
AsString = lbBoardMeetingDates.SelectedItem.Text
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue(
"@BoardMeeting_Dt",
DateSelected)
Dim da
AsNew SqlDataAdapter()
da.SelectCommand = cmd
Dim datatable
AsNew DataTable()
da.Fill(datatable)
' getting value according to imageID and fill dataset
Member
33 Points
251 Posts
Error Opening CrystalReportViewer on the Webserver
Apr 29, 2014 01:05 PM|liefie2000|LINK
When I try to open my CrystalReport on the Webserver I get this error;
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. SQL State: 08001 Native Error: Error in File C:\Windows\TEMP\cryVls1a33 {982C3F01-7159-47A6-B65C-771961E1F48A}.rpt: Unable to connect: incorrect log on parameters.
I set the connection string in the report and if got the connection info correct;
Dim ConnInfo As New ConnectionInfo
With ConnInfo
.ServerName = "##.###.##.#"
.DatabaseName = "***"
.UserID = "**********"
.Password = "********"
End With
Why does it work on my local host, but not on the Webserver?
Contributor
2564 Points
1919 Posts
Re: Error Opening CrystalReportViewer on the Webserver
Apr 29, 2014 01:26 PM|mike4u|LINK
you can solve this problem by installing SQL Native Client drivers (sqlncli.msi) in your server. You can download it from here
Sqlncli.msi After install sqlncli.msi component in server run your application it will work for you.
Member
33 Points
251 Posts
Re: Error Opening CrystalReportViewer on the Webserver
Apr 29, 2014 02:10 PM|liefie2000|LINK
We've got the drivers installed. Otherwise I wouldn't get my gridview working.
Member
594 Points
439 Posts
Re: Error Opening CrystalReportViewer on the Webserver
May 06, 2014 12:47 AM|itityagi|LINK
This is not the problem with the Crystal Report, the problem lies with the connection to the server. Please check the configuration settings in the web config.
Also if you have been given the rights to access database etc.
If any file needs to be downloaded. This can give you some direction.
:)
Member
33 Points
251 Posts
Re: Error Opening CrystalReportViewer on the Webserver
May 06, 2014 09:35 AM|liefie2000|LINK
Can you give me a sample web.config file to compare mine with?
Member
33 Points
251 Posts
Re: Error Opening CrystalReportViewer on the Webserver
May 13, 2014 03:35 PM|liefie2000|LINK
I went another way with this and just added a button to extract the CrystalReport to a PDF file Instead of letting the Viewer handle it. Sometimes things done by hand are better than a package deal.
Here is my code:
Dim cmd As New SqlCommand("sp_Report_BoardMeeting_Snapshot", con)
Dim DateSelected As String = lbBoardMeetingDates.SelectedItem.Text
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue(
"@BoardMeeting_Dt", DateSelected)
Dim da As New SqlDataAdapter()
da.SelectCommand = cmd
Dim datatable As New DataTable()
da.Fill(datatable)
' getting value according to imageID and fill dataset
Dim crystalReport As New ReportDocument()
' creating object of crystal report
crystalReport.Load(Server.MapPath(
"~\Reports\cryVls1a34.rpt"))
' path of report
crystalReport.SetDataSource(datatable)
crystalReport.SetParameterValue(
"@Heading", "Licensees approved at " & DateSelected & " Board Meeting")
' binding datatable
CrystalReportViewer1.ReportSource = crystalReport
crystalReport.ExportToHttpResponse(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat, Response,
True, "cryVls1a34")
'here i have use [ CrystalDecisions.Shared.ExportFormatType.PortableDocFormat ] to Export in PDF