Tuesday, March 27, 2012

Datasource credentails not saved if inside a batch

I am publishing an RDL using webservice. After publishing the report, i
update the embeded datasource for the report using "SetReportDataSources"
method.
If i use a "BatchHeader", with "ExecuteBatch" method the report is not
working. It says cannot login. I have to go the report datasource and retype
the password for the report to work.
But if I donot use "BatchHeader", the same code works.
This issue happens only on one of the reprot servers in our network. The
same code works on other report servers in the network. Is there a settings
in the report server or the server itself that is causing this.
Any help appreciated.I think in RS 2005 it was changed to SetItemDataSources(), anyway here's the
code we use for updating the datasources for the reports during deployment.
We create the datasource once, then for each report we deploy the report
then call this to update the datasource reference. We only use a single
datasource for all reports, so not too complex of an example. Depending on
the environment and version we change the datasource name.
Sub DSChange(ByVal ReportName As String)
Dim reference As new DataSourceReference()
Dim ds As New DataSource()
Dim dataSources() As DataSource
Try
reference.Reference = "/" & ReportDir & "/" & RSDSName
DataSources = rs.GetItemDataSources("/" & ReportDir & "/" &
ReportName)
ds = DataSources(0)
ds.Item = CType(reference, DataSourceDefinitionOrReference)
rs.SetItemDataSources("/" & ReportDir & "/" & ReportName,
DataSources)
Console.WriteLine("datasource reference set")
Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub
Steve MunLeeuw
"vRam" <vRam@.discussions.microsoft.com> wrote in message
news:D47581C0-F81B-4C34-A695-A1F95693A668@.microsoft.com...
>I am publishing an RDL using webservice. After publishing the report, i
> update the embeded datasource for the report using "SetReportDataSources"
> method.
> If i use a "BatchHeader", with "ExecuteBatch" method the report is not
> working. It says cannot login. I have to go the report datasource and
> retype
> the password for the report to work.
> But if I donot use "BatchHeader", the same code works.
> This issue happens only on one of the reprot servers in our network. The
> same code works on other report servers in the network. Is there a
> settings
> in the report server or the server itself that is causing this.
> Any help appreciated.
>|||thanks for the reply.
But our implementation is on RS2000.
Again our code is working on all the RS servers except one of them. that too
if we set the datasource within a transaction using BatchHeaders.
"Steve MunLeeuw" wrote:
> I think in RS 2005 it was changed to SetItemDataSources(), anyway here's the
> code we use for updating the datasources for the reports during deployment.
> We create the datasource once, then for each report we deploy the report
> then call this to update the datasource reference. We only use a single
> datasource for all reports, so not too complex of an example. Depending on
> the environment and version we change the datasource name.
>
> Sub DSChange(ByVal ReportName As String)
> Dim reference As new DataSourceReference()
> Dim ds As New DataSource()
> Dim dataSources() As DataSource
> Try
> reference.Reference = "/" & ReportDir & "/" & RSDSName
> DataSources = rs.GetItemDataSources("/" & ReportDir & "/" &
> ReportName)
> ds = DataSources(0)
> ds.Item = CType(reference, DataSourceDefinitionOrReference)
> rs.SetItemDataSources("/" & ReportDir & "/" & ReportName,
> DataSources)
> Console.WriteLine("datasource reference set")
> Catch e As Exception
> Console.WriteLine(e.Message)
> End Try
> End Sub
> Steve MunLeeuw
> "vRam" <vRam@.discussions.microsoft.com> wrote in message
> news:D47581C0-F81B-4C34-A695-A1F95693A668@.microsoft.com...
> >I am publishing an RDL using webservice. After publishing the report, i
> > update the embeded datasource for the report using "SetReportDataSources"
> > method.
> >
> > If i use a "BatchHeader", with "ExecuteBatch" method the report is not
> > working. It says cannot login. I have to go the report datasource and
> > retype
> > the password for the report to work.
> >
> > But if I donot use "BatchHeader", the same code works.
> >
> > This issue happens only on one of the reprot servers in our network. The
> > same code works on other report servers in the network. Is there a
> > settings
> > in the report server or the server itself that is causing this.
> >
> > Any help appreciated.
> >
> >
>
>