Link data source to report at reportsever in .rss file
Hi,
I want to deploy Reports on the Reportserver. Everything is working fine, if I deploy the source and the Reports into the same folder.
But If I change the folder of the Datasource to an other folder Data Sources, the reports don't find the connection. How can I set the connection to the Data Source deployed befor in my .rss file?
My Code:
Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim parentPath As String = "/" + targetFolder
Public Sub Main()
TRY
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
PublishReport()
Console.WriteLine("Report deployed successfully.")
CATCH ex As Exception
THROW ex
END TRY
End Sub
Public Sub PublishReport()
TRY
Dim stream As FileStream = File.OpenRead(sourcePath + "\" + reportName + ".rdl")
definition = New [Byte](stream.Length) {}
stream.Read(definition, 0, CInt(stream.Length))
stream.Close()
Dim warnings As Warning() = Nothing
rs.CreateCatalogItem("Report",reportName, parentPath, False, definition, Nothing,warnings)
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} created " + _
"successfully with no warnings", reportName)
End If
CATCH e As Exception
Console.WriteLine("ERROR while Publishing report: " + reportName)
THROW e
END TRY
End Sub
I hope you can help me!
Thanks
February 26th, 2011 7:04am
Please refer below link
http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/8f4d9e4e-e4b4-4d21-ac04-0dcfda9d50ff
http://msdn.microsoft.com/ru-ru/library/reportservice2010.reportingservice2010.createcatalogitem.aspxNanda
Free Windows Admin Tool Kit Click here and download it now
February 26th, 2011 9:33am