figuerres said:
Been a long time since I looked at the services details but I am thinking of two things to try ....
1) ask the server for the name/ names of shared data sources via the RS WS calls.
then give the user a GUI to pick the right name.
then use report class bits to update the report to have the ds name and then upload it.
that seems like the "right way" in general.
2) the report file is XML, the DS name is just a value in there some where..... use linq to xml or the older xml classes to update that and send it over.
#3 is what I do:
in my report project I have a ds that has a local server connection but the same name as the prodcution site.
so when I upload a report it already has the right name in it.
Hi figuerres,
thanks for the help; however I did it, I've pasted the code just in case it could be useful.
Dim DscItem As ProdCatalogListViewItem
For Each DscItem In ListView2.SelectedItems
If DscItem.Type = RSTarget.ItemTypeEnum.DataSource Then
Dim DscPathName As String = DscItem.Path
Dim RetRepPathDscName As New ArrayList()
'The function returns the target path where create report and datasource target name
RetRepPathDscName = RetRepPathTgt(RepName, DscPathName)
Dim RetPathName As String = RetRepPathDscName(0)
Dim RetDscName As String = RetRepPathDscName(1)
'Report publishing
Try
'Creazione del report
RSDest.CreateReport(RepItem.Text, RetPathName, chkPubOvrWrt.Checked, Definition, Nothing)
Catch ex As SoapException
Alert = True
Dim ErrMsg As String = "Err: report " & RepItem.Text & ControlChars.Lf
ErrMsg = ErrMsg & ex.Detail.InnerXml.ToString() & ControlChars.Lf
Dim Ret As Boolean = SaveLogFile(ErrMsg, LogPath)
End Try
'get definition of target datasource and the datasource properties in current report
Dim DscDefinition As RSProduzione.DataSourceDefinition = Nothing
DscDefinition = RSDest.GetDataSourceContents(DscPathName)
Dim DsReference As New RSProduzione.DataSourceReference()
DsReference.Reference = DscPathName
'Dim DataSources(0) As RSProduzione.DataSource
Dim DataSources() As RSProduzione.DataSource = RSDest.GetItemDataSources(RetPathName & "/" & RepItem.Text)
Dim ds As New RSProduzione.DataSource()
ds = DataSources(0)
'ds.Item = CType(DsReference, RSProduzione.DataSourceDefinitionOrReference)
ds.Item = CType(DsReference, RSProduzione.DataSourceReference)
'ds.Name = RetDscName
DataSources(0) = ds
'Set new datasource
Try
RSDest.SetItemDataSources(RetPathName & "/" & RepItem.Text, DataSources)
Catch ex As SoapException
'MsgBox(ex.Detail.InnerXml, MsgBoxStyle.Critical, "Errore")
'Console.WriteLine(ex.Detail.InnerXml.ToString())
Alert = True
Dim ErrMsg As String = "Err: report " & RepItem.Text & ControlChars.Lf
ErrMsg = ErrMsg & ex.Detail.InnerXml.ToString() & ControlChars.Lf
Dim Ret As Boolean = SaveLogFile(ErrMsg, LogPath)
'Exit Sub
End Try
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.