I am generating a spreadsheet using the same data source that a report created in SQL Server Report Builder uses. I downloaded the report's *.rdl file, and am using the three datasets it generates, two from simple queries, and one from a complex Stored Procedure.
Both the *.rdl file and the project in MS SQL Server Report Builder show me that there are only these two queries and the Stored Proc plainly affiliated with this report.
I am successfully getting all this data - the two queries supply values that I use to populate comboboxes, and the Stored Proc returns several fields which I use in the report's "Summary" section.
However, the legacy report, which I can generate either from SSRS (web page) or directly from Report Builder ALSO print a "Detail" section below the "Summary" section.
I don't know where this data is coming from - the *.rdl file contains only this reference to a "subreport" as a clue:
<Subreport Name="subreport1">
<Parameters>
<Parameter Name="BegDate">
<Value>=Parameters!BegDate.Value</Value>
</Parameter>
<Parameter Name="EndDate">
<Value>=Parameters!EndDate.Value</Value>
</Parameter>
<Parameter Name="Member">
<Value>=Parameters!Member.Value</Value>
</Parameter>
<Parameter Name="Unit">
<Value>=Parameters!Unit.Value</Value>
</Parameter>
<Parameter Name="Type">
<Value>=Fields!T.Value</Value>
</Parameter>
</Parameters>
. . .
I don't supply a "Type" parameter - I get the "Summary" data using the other four parameters. And the values displayed in the subreport do not appear in the *.rdl file. Where could these be coming from?
I look for the returned values from the Stored Proc this way:
string[] columnNames = dtPriceComplianceResults.Columns.Cast<DataColumn>()
.Select(x => x.ColumnName)
.ToArray();
if (columnNames.Length > 5)
{
MessageBox.Show("more than 5");
// TODO: If there are more fields, use these to generate the "Details" section of the report
}
...but it never has more than the few fields which are used to populate the "Summary" section of the report/spreadsheet.
Is it possible that if I supply a value to the "Type" parameter, I might get more data? Even if so, it's highly vexing/perplexing to me that there seems to be no reference to this subreport's data source within the *.rdl file.
UPDATE
Is it possible that the "Type" parameter is supplied for the user right in the *.rdl file? (I'm home now, and don't have access to it to look, but I wonder if that's a common pattern for *.rdl files, or at least something that's possible).
If so, maybe the Type parameter provides returns those additional fields.
<Subreport>should have a child element called:<ReportName>that contains a path to the subreport (within the SSRS pseudo-folders). Something like:<ReportName>/Dev/TestSubReport</ReportName>Do you see that element in theRDLyou downloaded? - David TanseyTypeparameter is a parameter of the subreport, not the main report, and gets supplied the value from the current report'sTfield when the subreport is run. - Chris Latta