Visual Studio 2010要求将在VS2008上创建的RDLC转换为RDLC 2008格式?

Jun*_*r M 9 reportviewer2008 rdlc visual-studio-2010 visual-studio-2008

我在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)}
Run Code Online (Sandbox Code Playgroud)

小智 10

在将早期版本的rdlc转换为VS2010时,我遇到了类似的问题.转换很好,需要做的是对Microsoft.ReportViwer.Common的引用必须从版本9更改为版本10.对Microsoft.ReportViewer.WebForms也一样.您还需要将web.config和包含ReportViewer控件的页面中的版本9的所有引用更改为版本10.这解决了我的所有问题,并且能够在VS2010中修改报表.


小智 5

这比设置为答案的回复简单得多......

您需要做的就是从项目中删除对ReportViewer的引用(因为它们仍指向版本9),然后转到添加引用并选择版本10的ReportViewer引用.


Jun*_*r M 1

Here\xc2\xb4s 是一个解决方法。

\n\n
    \n
  • 不要在 VS2010 中转换或编辑你的报告(那里\xc2\xb4s有问题)

  • \n
  • 安装报表查看器 2008 安装

  • \n
  • SQL Server 商业智能工作室 2008

  • \n
  • 在 SQL Server Business Intelligence 中,为您的报表创建一个空项目

  • \n
  • 将文件扩展名重命名为 .rdl,在此项目中添加现有的 rdl 文件。

  • \n
  • 构建并部署您的项目

  • \n
\n