我在 Visual Studio 2008 上创建了我的项目,以及上面的 RDLC 文件。但是现在,当我在 Visual Studio 2010 上打开解决方案并想要打开 RDLC 文件时,它会向我显示警告。
这有点好笑。该报告是在 VS2008 上创建的,VS2010 要求转换为 2008 格式。也许我的 VS2008 安装存在问题,它使用某种古老的格式(2005 年??!)创建了 RDLC 文件
问题是,当您使用 Ok 按钮确认,进行一些设计调整并运行应用程序时,它会在“主报告”上引发错误:
ex.InnerException
{"The definition of the report 'Main Report' is invalid."}
[Microsoft.Reporting.DefinitionInvalidException]: {"The definition of the report 'Main Report' is invalid."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: {"The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded."}
Message: "The definition of the report 'Main Report' is invalid."
Source: "Microsoft.ReportViewer.Common"
StackTrace: " at Microsoft.Reporting.ReportCompiler.CompileReport(CatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ReportSnapshotBase& snapshot)\r\n at Microsoft.Reporting.StandalonePreviewStore.StoredReport.CompileReport()\r\n at Microsoft.Reporting.StandalonePreviewStore.StoredReport.get_Snapshot()\r\n at Microsoft.Reporting.StandalonePreviewStore.GetCompiledReport(CatalogItemContext context, Boolean rebuild, ReportSnapshotBase& snapshot)\r\n at Microsoft.Reporting.LocalService.GetCompiledReport(CatalogItemContext itemContext, Boolean rebuild, ReportSnapshotBase& snapshot)\r\n at Microsoft.Reporting.LocalService.CompileReport(CatalogItemContext itemContext, Boolean rebuild)\r\n at Microsoft.Reporting.WinForms.LocalReport.CompileReport()"
TargetSite: {Microsoft.ReportingServices.ReportProcessing.PublishingResult CompileReport(Microsoft.ReportingServices.Diagnostics.CatalogItemContext, Byte[], Boolean, Microsoft.ReportingServices.Library.ReportSnapshotBase ByRef)}