Tuesday, March 27, 2012

Datasource properties while publishing report

Hi,
I am having problem where I am uploading report and setting its datasource
properties using rs.setproperties. I had defined datasource but it says â'data
source in not published on report serverâ' or
â'System.Web.Services.Protocols.SoapException: The required field DataSource
is mi
ssing from the input structure. -->
Microsoft.ReportingServices.Diagnostics.Uti
lities.MissingElementException: The required field DataSource is missing
from th
e input structure.â'
. Any idea how to resolve this problem I am also attaching code for your
reference
Dim reference As New DataSourceReference()
reference.Reference = "/Report Project1/EBS"
Dim dataSources(1) As DataSource
Dim ds As New DataSource()
ds.Item = CType(reference, DataSourceDefinitionOrReference)
ds.Name = "EBS"
dataSources(0) = ds
Try
rs.SetReportDataSources(â'abc.rdlâ', dataSources)
Console.WriteLine("New reference set for the report.")
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml.ToString())
End Try
Thanks in Advance
JasvinderI know this might not totally make sense, but in the line where you declare
the dataSources variable, use the following syntax:
Dim dataSources(0) As DataSource
instead of:
Dim dataSources(1) As DataSource
and I bet it will work for you! Hope it does. -Aaron
"Jasvinder" wrote:
> Hi,
> I am having problem where I am uploading report and setting its datasource
> properties using rs.setproperties. I had defined datasource but it says â'data
> source in not published on report serverâ' or
> â'System.Web.Services.Protocols.SoapException: The required field DataSource
> is mi
> ssing from the input structure. -->
> Microsoft.ReportingServices.Diagnostics.Uti
> lities.MissingElementException: The required field DataSource is missing
> from th
> e input structure.â'
>
> . Any idea how to resolve this problem I am also attaching code for your
> reference
>
> Dim reference As New DataSourceReference()
> reference.Reference = "/Report Project1/EBS"
> Dim dataSources(1) As DataSource
> Dim ds As New DataSource()
> ds.Item = CType(reference, DataSourceDefinitionOrReference)
> ds.Name = "EBS"
> dataSources(0) = ds
>
> Try
> rs.SetReportDataSources(â'abc.rdlâ', dataSources)
> Console.WriteLine("New reference set for the report.")
> Catch e As SoapException
> Console.WriteLine(e.Detail.InnerXml.ToString())
> End Try
>
> Thanks in Advance
> Jasvinder
>|||Hi Aaron,
Yes i had figured out this problem and i am still not understanding how this
can work. Thought of posting messege to MS.
But anyhow thanks for the solution.
Another problem which is coming is "Unhandled
Exception:System.Security.SecurityPermission" I have added try catch block
everywhere but still in the process of finding this error. Moreover its
frequency of coming is not sure. Sometimes it does not comes and sometimes it
comes and vice versa.
Thanks
Jasvinder
"Aaron Williams" wrote:
> I know this might not totally make sense, but in the line where you declare
> the dataSources variable, use the following syntax:
> Dim dataSources(0) As DataSource
> instead of:
> Dim dataSources(1) As DataSource
> and I bet it will work for you! Hope it does. -Aaron
>
> "Jasvinder" wrote:
> > Hi,
> > I am having problem where I am uploading report and setting its datasource
> > properties using rs.setproperties. I had defined datasource but it says â'data
> > source in not published on report serverâ' or
> >
> > â'System.Web.Services.Protocols.SoapException: The required field DataSource
> > is mi
> >
> > ssing from the input structure. -->
> > Microsoft.ReportingServices.Diagnostics.Uti
> >
> > lities.MissingElementException: The required field DataSource is missing
> > from th
> >
> > e input structure.â'
> >
> >
> >
> > . Any idea how to resolve this problem I am also attaching code for your
> > reference
> >
> >
> >
> > Dim reference As New DataSourceReference()
> >
> > reference.Reference = "/Report Project1/EBS"
> >
> > Dim dataSources(1) As DataSource
> >
> > Dim ds As New DataSource()
> >
> > ds.Item = CType(reference, DataSourceDefinitionOrReference)
> >
> > ds.Name = "EBS"
> >
> > dataSources(0) = ds
> >
> >
> >
> > Try
> >
> > rs.SetReportDataSources(â'abc.rdlâ', dataSources)
> >
> > Console.WriteLine("New reference set for the report.")
> >
> > Catch e As SoapException
> >
> > Console.WriteLine(e.Detail.InnerXml.ToString())
> >
> > End Try
> >
> >
> >
> > Thanks in Advance
> > Jasvinder
> >sql