我需要制作将在本地处理报告的报告查看器。我得到了带有查询的 RDL 文件。有没有办法将连接字符串插入到报表的 XML 代码中,以便报表可以直接从数据库中获取数据?报告将显示在 MS reportViewer 中。
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition">
<DataSources>
<DataSource Name="BIA">
<DataSourceReference>BIA</DataSourceReference>
<rd:DataSourceID>98fa74a9-d829-4196-be9d-49697ded5201</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="RelItems">
<Fields>
<Field Name="RelItemID">
<DataField>RelItemID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="SSISPackageName">
<DataField>SSISPackageName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>BIA</DataSourceName>
<CommandText>select b.ID as RelItemID, SSISPName --+ ' ('+s.Name + ' -> ' + d.Name + ')'
as SSISPackageName
from dbo.RelTypes_ProvTypes a
inner join dbo.RelItems b on a.RelTypeID = b.RelTypeID
inner join dbo.ObjItems s on b.ObjItemIDSource = s.ID and a.ObjTypeIDSource = s.ObjTypeID
inner join dbo.ObjItems d on b.ObjItemIDDest = d.ID and a.ObjTypeIDDest = d.ObjTypeID
where SSISPName is not null
order by 2</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
</DataSet>
... and so on
这是我拥有的 RDL。欢迎任何其他提示或帮助,只需要让它工作:)