Unable to connect to remote server – error

If you get this message say from Visual Studio when trying to deploy SSRS reports to a SQL Server 2008 database instance, heres how this can be resolved. This is usually caused by kerberos security authentication. Navigate to: C:Program FilesMicrosoft SQL ServerMSRS10.MSSQLSERVERReporting ServicesReportServer Edit the file rsreportserver.config
Make the change below:
<!–<Add Key=”SecureConnectionLevel” Value=”2″/>–>
Add Key=SecureConnectionLevel Value=0/>

 Restart Reportserver. You should be able to deploy your reports now to SQL Server Reporting Services 2008.

Reportviewer control

Here is a code snippet l got working which enables you to render using Visual Basic .Net an SSRS (Sql Server Report Services) Report to Adobe Acrobat PDF format or Microsoft Excel XLS file.

Public Sub RenderReportTOExcel(ByVal inReportFileName As String, ByVal inReportName As String)   ‘7/14/2008 SM

        ‘converts SSRS report to microsoft excel/acrobat pdf file

        Dim objReportViewer As New FrmWithReportViewer
                ‘Dim strFormat As String = “PDF”
        Dim strFormat As String = “Excel”
        Dim strDeviceInfo As String = String.Empty
        Dim myURLAccessParams As System.Collections.Specialized.NameValueCollection = Nothing
        Dim reportStream As System.IO.Stream = Nothing
        Dim strMimeType As String = String.Empty
        Dim strFileNameExtension As String = String.Empty

        Dim file_name As String = “d:test001.xls”
        objReportViewer.Text = inReportName

        OFD.FileName = “exportfile.xls”
        file_name = OFD.FileName

        Dim raw As System.IO.FileStream = New System.IO.FileStream(file_name, IO.FileMode.Create)
        Dim buffer(1024) As Byte
        Dim read As Integer = -1
        Dim intCount As Integer = 1


        With objReportViewer.ReportViewer
            .ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote
            .ServerReport.ReportServerUrl = New Uri(My.Settings.ReportServerURL)
            .ServerReport.ReportPath = My.Settings.ReportPath + inReportFileName
            reportStream = .ServerReport.Render(strFormat, strDeviceInfo, myURLAccessParams, strMimeType, strFileNameExtension)

            lblMessage.Text = “Working…”
            read = reportStream.Read(buffer, 0, buffer.Length)

            While (read > 0)
                raw.Write(buffer, 0, read)
                read = reportStream.Read(buffer, 0, buffer.Length)
                intCount += 1
            End While

            lblMessage.Text = “Completed.”

        End With

        raw = Nothing
        reportStream = Nothing

    End Sub