RS Web Services 在發佈 2008 R2 的 RDL 時,會檢查多的 byte

Dim stream As FileStream = File.OpenRead(filePath + reportName + ".rdl")
definition = New [Byte](stream.Length-1) {}
stream.Read(definition, 0, CInt(stream.Length))
stream.Close()
若讀取 2008 的 RDL 發佈到 RS 沒問題,但若是 2008 R2 RDL 則會有以下錯誤:

System.Web.Services.Protocols.SoapException: 報表定義無效,或是這個版本的 Report
ing Services 不支援該報表定義。這可能是發行最新版 Reporting Services 的報表定義
所造成,或者是因為報表定義包含格式不正確的 XML,或 XML 就報表定義結構描述而言無
效。詳細資料: ‘.’ (十六進位值 0x00) 是無效的字元。 第 466 行,位置 10
   於 Microsoft.ReportingServices.WebServer.ReportingService2010Impl.CreateRepor
t(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[]
Properties, CatalogItem& ItemInfo, Warning[]& Warnings)
   於 Microsoft.ReportingServices.WebServer.ReportingService2010Impl.CreateCatal
ogItem(String ItemType, String Name, String Parent, Boolean Overwrite, Byte[] De
finition, Property[] Properties, CatalogItem& ItemInfo, Warning[]& Warnings)
   於 Microsoft.ReportingServices.WebServer.ReportingService2010.CreateCatalogIt
em(String ItemType, String Name, String Parent, Boolean Overwrite, Byte[] Defini
tion, Property[] Properties, CatalogItem& ItemInfo, Warning[]& Warnings)

 

 

重點在最後一行說明,但說明的起始讓人誤解

發表留言