Friday, March 30, 2012

rsInvalidDataSourceReference

I am getting the following error:

  • The report server cannot process the report. The data source connection information has been deleted. (rsInvalidDataSourceReference)

    All i did is created the datasource in the same location where my report files .rdl files are. instead of datasource folder on the report server.

    everything works fine from my project vs2005, but if i run the report via localhost/reports, it gives the above error:

    please help, i created this method since i have 5 different sites on the same server, all of the sites has reports with same datasource name many of them are common for that reason.

    Thank you very much for the informartion.

    Try this:

    Open up Report Manager, and drill down to open your report. Click on the Properties tab, then select 'Data Sources' from the left pane. Click the Browse button next to 'Select a shared data source'. From here, navigate to the folder where your report is, and select the data source that is in there (since this is where you deployed to). Click OK, then Apply your changes.

    Hope this helps.

    Jarret

    |||Wow.. Jarret Thank you very much. you gave me two tips since yesterday. thks....|||

    Hi,

    I am using a rss script to deploy reports and data sources. All my datasources lie in the shared location "Data Sources". With the script the data source and reports are deployed but the it gives the same error as posted by cplusplus1.

    Here is the rss script to deploy report and data source that I used. Please help.

    'To deploy Data Source

    Public Sub CreateDataSource(ByVal name As String, ByVal extension As String, ByVal connectionString As String)
    'Define the data source definition.
    Dim definition As New DataSourceDefinition()
    definition.Extension = extension
    definition.ConnectString = connectionString
    definition.Enabled = True
    definition.EnabledSpecified = True
    definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
    definition.WindowsCredentials = True
    definition.Prompt = Nothing
    definition.ImpersonateUserSpecified = True
    Try
    rs.CreateDataSource(name, dataSourcePath, overWriteExistingDataSource, definition, Nothing)
    Console.WriteLine("Data source {0} created successfully", name)

    Catch e As Exception
    Console.WriteLine(e.Message)
    End Try

    End Sub


    ' TO DEPLOY Report

    Public Sub PublishReport(ByVal reportName As String)
    Try
    Dim stream As FileStream = File.OpenRead(filePath + reportName + ".rdl")
    definition = New [Byte](stream.Length) {}
    stream.Read(definition, 0, CInt(stream.Length))
    stream.Close()

    Catch e As IOException
    Console.WriteLine(e.Message)
    End Try

    Try
    warnings = rs.CreateReport(reportName, parentPath, False, definition, Nothing)

    Dim dataSources() As DataSource = rs.GetItemDataSources(parentPath + "/" + reportName)

    Dim ds As DataSource
    For Each ds In dataSources
    If (ds.Item.GetType() Is Type.GetType("InvalidDataSourceReference")) Then
    Dim NewDS As DataSource = New DataSource()
    Dim dsRef As DataSourceReference = New DataSourceReference()

    dsRef.Reference = dataSourcePath + "/" + dataSourceName
    NewDS.Item = dsRef
    NewDS.Name = ds.Name
    Dim NewDataSources() As DataSource = New DataSource() {NewDS}

    rs.SetItemDataSources(parentPath + "/" + reportName, NewDataSources)
    End If
    Next

    If Not (warnings Is Nothing) Then
    Dim warning As Warning
    For Each warning In warnings
    Console.WriteLine(warning.Message)
    Next warning
    Else
    Console.WriteLine("Report: {0} published successfully with no warnings", reportName)
    End If
    Catch e As Exception
    Console.WriteLine(e.Message)
    End Try
    End Sub

  • No comments:

    Post a Comment