The required field DataSource is missing from the input structure
In my case, I tracked it down to sample code I'd copied from
MSDN: ReportingService.SetReportDataSources.
I'm using VB.NET (argh!), and the dataSources array declaration in this sample code is the cause of the error.
Dim dataSources(1) As DataSource
actually creates a two-element array BUT we only set one element
dataSources[0] = ds;
so when this line executes
rs.SetReportDataSources("/SampleReports/Product Catalog", dataSources)
it is actually sending an array where the zeroth element is set to a valid object, but the first element is NULL... hence the (somewhat cryptic) "required field DataSource is missing" error.
The fix?
Dim dataSources(0) As DataSource
No comments:
Post a Comment
Note: only a member of this blog may post a comment.