天天看點

如何将 Sql Server 2008R2 生成的.rdl檔案轉換成Sql Server 2008版本的rdl

如果你的電腦上安裝着sql server 2008R2,但ssrs的工程是由sql server 2008生成的,當你添加一個新的report的時候可能會出現錯誤:

Error while building reporting solution in VS 2008: Error  111         [rsInvalidReportDefinition] The report definition is not valid.  Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition' which cannot be upgraded.               

這是因為sql server 2008不能分辨R2産生的檔案,如何将其轉換成sql server 2008的檔案呢,下面是解決方案:(懶得翻譯了)

In this post, I’d like to share my careless experience by installing two version of BIDS in my work laptop that cause a delay for my team to deploy the report that I’d worked on. So, if you happen to have SQL2008R2 and SQL2008 installed on the same machine AND happen to modify one your RDL file, I promised that you won’t be able to open it in SQL2008 BIDS, which I thought it should because it’s still SQL2008 (silly assumption).

Anyway, to solve the issue OR to convert the RDL back to SQL2008 version, open your RDL file with any text editor and to do the following two replacements:

1. Schema

Look for:

<Report xmlns:rd=”http://schemas.microsoft.com/SQLServer/reporting/reportdesigner” xmlns=”http://schemas.microsoft.com/sqlserver/reporting/2009/01/reportdefinition“>

Replace it with:

<Report xmlns:rd=”http://schemas.microsoft.com/SQLServer/reporting/reportdesigner” xmlns=”http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition“>

2. Look for:

<ReportSections>

    <ReportSection>

AND its pair:

</ReportSection>

  </ReportSections>

If you found it, remove it.

Save the RDL file and ta-da…you can open it again in BIDS 2008 without losing your work.

Hope this post help you.

Cheers,

Uzzie

QUICK NOTE:

Just be careful when you copy and paste Schema section from here into your RDL because the double quotes will turn to some funny character. You need to replace it with correct double quotes.