解决方法
这将给出报告与Xml报告定义的列表:
SELECT Name,CAST(CAST(Content AS VARBINARY(MAX)) AS XML) AS ReportXML FROM ReportServer.dbo.Catalog where Type = 2 order by Name
您需要的信息在DataSets部分,示例如下.报表中可能有多个查询/存储过程.
<DataSets> <DataSet Name="SalesSummary"> <Query> <CommandType>StoredProcedure</CommandType> <CommandText>rptSalesSummary</CommandText> <QueryParameters> <QueryParameter Name="@STARTDATE"> <Value>=Parameters!STARTDATE.Value</Value> </QueryParameter> <QueryParameter Name="@ENDDATE"> <Value>=Parameters!ENDDATE.Value</Value> </QueryParameter> </QueryParameters> <DataSourceName>SampleDB</DataSourceName> </Query> . . . </DataSet> <DataSet Name="CompanyLocation"> <Query> <DataSourceName>SampleDB</DataSourceName> <CommandText> SELECT CompanyLocationID AS ID,Name FROM tblCompanyLocation WHERE WareHouSEOnlyInd = 0 ORDER BY Description </CommandText> <rd:UseGenericDesigner>true</rd:UseGenericDesigner> </Query> </DataSet> . . .
见http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition/ReportDefinition.xsd