Problems loading my Crystal reports


I am trying to generate a report, the way I send the parameters and the connection data are the following

Dim variables () As String = New String (3) {}

    Dim ireport As New ReportDocument()
    Dim iConnectionInfo As ConnectionInfo = New ConnectionInfo()

    '------NUEVO para   la conexion 
    Dim DataBaseName As String = "RH_Vacaciones_Estructura"
    Dim UserID As String = "rhdato"
    Dim Password As String = "8989"
    Dim ServerName As String = "" 'System.Web.Configuration.WebConfigurationManager.AppSettings("ServerBD").ToString

    Dim miConexionInfo As ConnectionInfo = New ConnectionInfo()
    miConexionInfo.DatabaseName = DataBaseName
    miConexionInfo.UserID = UserID
    miConexionInfo.Password = Password
    miConexionInfo.ServerName = ServerName

    If ireport.IsLoaded Then
    End If

    Dim ruta As String = Server.MapPath("rpt_vacaciones_historial_C.rpt")
    Dim pvValoresParametros As New ParameterValues()

    variables(0) = txtcedula.Text

    If variables(0).ToString <> String.Empty Then
        variables(0) = variables(0)
        variables(0) = Nothing
    End If

    SetDBLogonForReport(miConexionInfo, ireport)
    ireport.SetParameterValue("@Cedula", variables(0))
    Session("reporte") = ireport
    CrystalReportViewer1.ReportSource = ireport

but I get the following error

If I remove the following line of code

SetDBLogonForReport (miConexionInfo, ireport)

shows me the report only that it shows a window where it asks for the parameters of the database, and then shows the data

asked by Sofia 12.11.2018 в 21:12

0 answers