9

我在 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)}
4

5 回答 5

10

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

于 2012-03-22T14:32:22.753 回答
5

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

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

于 2012-06-28T10:32:23.993 回答
2

只是为了消除您对版本的困惑:

发布 Visual Studio 2008 时,并未发布 RDL 2008 架构。因此 VS 2008 仅支持 RDL 2005 模式。VS 2010 支持 RDL 2008 架构。RDL 架构比 Visual Studio 版本落后一个版本,正如您所见,它有时是一些混乱的根本原因。

于 2010-09-13T14:07:21.127 回答
1

这是一种解决方法。

  • 不要在 VS2010 中转换或编辑您的报告(那里有问题)

  • 安装 Report Viewer 2008 安装

  • SQL Server 商业智能工作室 2008

  • 在 SQL Server 商业智能中,为您的报表创建一个空项目

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

  • 构建和部署您的项目

于 2010-07-01T19:14:28.280 回答
0
<httpHandlers>
  <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
  <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
        <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </handlers>
</system.webServer>
于 2012-05-29T13:42:10.760 回答