RDLC报告将无法运行-无效的命名空间2016/01

时间:2018-07-06 13:21:54

标签: c# reporting-services visual-studio-2017 rdlc

我正在尝试使用C#和Visual Studio 2017开发可打印本地报告的控制台应用程序。我收到以下异常。

  

Microsoft.Reporting.WinForms.LocalProcessingException:错误   发生在本地报告处理期间。 ->   Microsoft.Reporting.DefinitionInvalidException:   报告   'h:\ vs17 \ RackRoom \ EndOfDay \ TransactionReport \ RackRoom.Reports.EndOfDay.TransactionReport.rdlc'   是无效的。 ->   Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:   报告定义无效。详细信息:报告定义   目标名称空间无效   'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition'   无法升级。在   Microsoft.ReportingServices.ReportPublishing.ReportPublishing.Phase1(ICatalogItemContext   reportContext,Byte []定义,IChonkFactory createChunkCallback,   CheckSharedDataSource checkDataSourceCallback,   ResolveTemporaryDataSource resolveTemporaryDataSourceCallback,   DataSourceInfoCollection originalDataSources,IDataProtection   dataProtection,字符串和描述,字符串和语言,   DataSourceInfoCollection&dataSources,Boolean&hasExternalImages,   布尔值和hasHyperlinks)   Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateIntermediateFormat(ICatalogItemContext   reportContext,Byte []定义,IChonkFactory createChunkCallback,   CheckSharedDataSource checkDataSourceCallback,   ResolveTemporaryDataSource resolveTemporaryDataSourceCallback,   DataSourceInfoCollection originalDataSources,PublishingErrorContext   errorContext,AppDomain编译TempAppDomain,布尔   generateExpressionHostWithRefusedPermissions,IDataProtection   dataProtection,字符串和描述,字符串和语言,   ParameterInfoCollection&参数,DataSourceInfoCollection&   dataSources,UserLocationFlags&userReferenceLocation,ArrayList&   dataSetsName,Boolean&hasExternalImages,Boolean&hasHyperlinks)
  在   Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport(ICatalogItemContext   reportContext,字节[] reportDefinition,IChunkFactory   createChunkCallback,CheckSharedDataSource checkDataSourceCallback,   ResolveTemporaryDataSource resolveTemporaryDataSourceCallback,   DataSourceInfoCollection originalDataSources,PublishingErrorContext   errorContext,AppDomain编译TempAppDomain,布尔   generateExpressionHostWithRefusedPermissions,IDataProtection   dataProtection,String&reportDescription,String&reportLanguage,   ParameterInfoCollection&参数,DataSourceInfoCollection&   dataSources,UserLocationFlags&userReferenceLocation,ArrayList&   dataSetsName,Boolean&hasExternalImages,Boolean&hasHyperlinks)
  在   Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(ICatalogItemContext   reportContext,字节[] reportDefinition,IChunkFactory   createChunkFactory,CheckSharedDataSource checkDataSourceCallback,   ResolveTemporaryDataSource resolveTemporaryDataSourceCallback,   DataSourceInfoCollection originalDataSources,AppDomain   乙太网路编译TempAppDomain,布尔值   generateExpressionHostWithRefusedPermissions,ReportProcessingFlags   processingFlags,IDataProtection dataProtection)位于   Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext   上下文,Byte [] reportDefinition,布尔   generateExpressionHostWithRefusedPermissions,ControlSnapshot&   快照)-内部异常堆栈跟踪的结尾-在   Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext   上下文,Byte [] reportDefinition,布尔   generateExpressionHostWithRefusedPermissions,ControlSnapshot&   快照)   Microsoft.Reporting.PreviewStore.StoredReport.EnsureCompiled(CatalogItemContextBase   itemContext)在   Microsoft.Reporting.PreviewStore.GetCompiledReport(CatalogItemContextBase   上下文,布尔值重建,Byte []&reportDefinition,ControlSnapshot&   快照)   Microsoft.Reporting.LocalService.GetCompiledReport(CatalogItemContextBase   itemContext,布尔值重建,ControlSnapshot和快照)   Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
  ---内部异常堆栈跟踪的结尾---在Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
  在Microsoft.Reporting.WinForms.LocalReport.InternalRender(String   格式,布尔值allowInternalRenderers,字符串deviceInfo,   PageCountMode pageCountMode,CreateAndRegisterStream   createStreamCallback,Warning []和警告),网址为   Microsoft.Reporting.WinForms.LocalReport.Render(字符串格式,字符串   deviceInfo,PageCountMode,pageCountMode,CreateStreamCallback   createStream,Warning []和警告)   Microsoft.Reporting.WinForms.LocalReport.Render(字符串格式,字符串   deviceInfo,CreateStreamCallback createStream,警告[]和警告)
  在RackRoom.EndOfDay.TransactionReport.Export(LocalReport report)中   H:\ vs17 \ RackRoom \ EndOfDay \ TransactionReport \ TransactionReport.cs:line   189在RackRoom.EndOfDay.TransactionReport.Main()中   H:\ vs17 \ RackRoom \ EndOfDay \ TransactionReport \ TransactionReport.cs:line   147

我已经搜索并尝试了所有可以找到的一切,包括The report definition is not valid. Details: The report definition has an invalid target namespace上的答案,但是我的项目中没有Microsoft.ReportingServices.ReportViewerControl.WebForms的引用,因为(1)这不是Web项目使用asp.net,并且(2)报告是本地RDLC文件。

该报告昨天有效,在我进行了一些格式更改后,它停止了工作。我很绝望。从昨天开始,我无权访问未经修改的资源,即使我可以访问,也需要了解为什么会这样。

(我讨厌这个&@ *%#P.O.S.报告工具。)

1 个答案:

答案 0 :(得分:0)

我从头开始重建了报表,重新添加了数据集,然后一次将Tablix从旧报表复制到新报表中,以查看引起问题的原因。他们都没有。我仍然不知道为什么旧报表中会发生异常。