問題描述:
VS的報表定義工具,不同的VS版本支持使用的不同,且VS2017新增報表文件rdlc使用的版本是舊版本2010,爲其新增參數變量後,報表定義
從2008版本自動變成2016,且執行報錯(錯誤原因未知)。VS2010的報表定義還是2008版的。
2008版的報表定義申明:
<Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition">
2016版的報表定義申明:
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition"
xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
2010 與2016 的報表定義相比較,2016多了這些內容:
<ReportSection>
<ReportSections>
</ReportSection>
</ReportSections>
<ReportParametersLayout>
<GridLayoutDefinition>
<NumberOfColumns>1</NumberOfColumns>
<NumberOfRows>1</NumberOfRows>
<CellDefinitions>
<CellDefinition>
<ColumnIndex>0</ColumnIndex>
<RowIndex>0</RowIndex>
<ParameterName>PlanId</ParameterName>
</CellDefinition>
</CellDefinitions>
</GridLayoutDefinition>
</ReportParametersLayout>
解決方法:
打開rdlc文件,必須將2016 版本改成2010 ,刪除多餘的部分。 內部內容保留,纔可以使用。