我已经在Visual Studio 2008上创建了我的项目,以及在其上的RDLC文件。
但是现在,当我在Visual Studio 2010上打开解决方案并想要打开RDLC文件时,它向我显示警告。
有点可笑。该报告是在VS2008上创建的,而VS2010要求转换为2008格式。也许我的VS2008安装存在问题,该问题使用某种古老的格式创建了RDLC文件(2005 ??!)。
问题是,当您单击“确定”按钮确认时,进行一些设计调整并运行该应用程序,会在“主报告”上引发错误:
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)}
最佳答案
将rdlc的早期版本转换为VS2010时遇到类似的问题。转换很好,需要进行的操作是必须将对Microsoft.ReportViwer.Common的引用从版本9更改为版本10。对Microsoft.ReportViewer.WebForms也执行相同的操作。您还需要在web.config和包含ReportViewer控件的页面中将版本9的所有引用更改为版本10。这解决了我的所有问题,并且能够在VS2010中修改报告。
关于visual-studio-2008 - Visual Studio 2010是否要求将在VS2008上创建的RDLC转换为RDLC 2008格式?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2906626/