Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Deploy report via code

Author  Topic 

mehrdadc48
Starting Member

2 Posts

Posted - 2009-07-09 : 08:46:55
Hi everybody,
I've written this code for publish reports on ReportServer.Everything is ok, but if I have SharedDataSource it says:
---------------------------
The dataset ‘NewDT’ refers to the shared data source ‘NewDT’, which is not published on the report server.
---------------------------
what's wrong?

Dim TmpEncoding As New System.Text.UTF8Encoding
Dim TmpReportDefinition() As Byte = TmpEncoding.GetBytes(PRdl)
TmpRsProxy.CreateReport(PReportName, PParentPath, True, TmpReportDefinition, Nothing)
Dim TmpDataSources As DataSource() = TmpRsProxy.GetItemDataSources(PParentPath & "/" & PReportName)
For Each TmpDataSource As DataSource In TmpDataSources Dim dSource As New DataSource
Dim dDefinition As New DataSourceDefinition() dSource.Item = dDefinition
dDefinition.Extension = "Sql"
dDefinition.ConnectString = "Data Source=" + ClsSetting.DbServerName + ";Initial Catalog=" + ClsSetting.DbName dDefinition.ImpersonateUserSpecified = True dDefinition.Prompt = Nothing dDefinition.WindowsCredentials = True dDefinition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
dSource.Name = TmpDataSource.Name
Try
TmpRsProxy.CreateDataSource(dSource.Name, ClsSetting.DataSourceLocation, True, dDefinition, Nothing)
If TypeOf (TmpDataSource.Item) Is DataSourceReference Then
Dim DsReference As New DataSourceReference()
Dim ds As New DataSource
DsReference.Reference = ClsSetting.DataSourceLocation + "/" + dSource.Name
Dim DataSources() As DataSource = TmpRsProxy.GetItemDataSources(PParentPath & "/" & PReportName)
ds = DataSources(0)
ds.Item = CType(DsReference, DataSourceReference) ds.Name = TmpDataSource.Name TmpRsProxy.SetItemDataSources(PParentPath + "/" + PReportName, DataSources)
End If
Catch ex As System.Web.Services.Protocols.SoapException
Throw ex
End Try
Next
   

- Advertisement -