首页 > 解决方案 > 如何在 Angular 应用程序中显示 SSRS 报告?

问题描述

我们正在将报表从 WindowsForm 应用程序迁移到 Angular Web 应用程序。

WindowsForm 使用 ReportViewer 在屏幕上显示报告,因此我在 Angular 上搜索了它的替代方案并找到了ngx-ssrs-reportviewer包。它看起来正是我所需要的,所以我按照说明安装它并将它包含在我的模块文件中,必须安装一些报告为丢失的包(@angular/elements 和 @webcomponents/custom-elements)但是当我运行 'ng serve' 我遇到了这个错误信息:

Uncaught TypeError: Cannot read property 'call' of undefined
    at __webpack_require__ (inline.bundle.js:55)
    at eval (webpack-internal:///../../../../../src/app/app.module.ts:47)
    at Object.../../../../../src/app/app.module.ts (main.bundle.js:244)
    at __webpack_require__ (inline.bundle.js:55)
    at eval (webpack-internal:///../../../../../src/main.ts:4)
    at Object.../../../../../src/main.ts (main.bundle.js:940)
    at __webpack_require__ (inline.bundle.js:55)
    at Object.0 (main.bundle.js:962)
    at __webpack_require__ (inline.bundle.js:55)
    at webpackJsonpCallback (inline.bundle.js:26)

我已经用谷歌搜索了这个错误,但我还没有找到解决方案。

配置

这是 app.module.ts 文件:

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AppComponent } from './app.component';
import { ReportViewerModule } from "ngx-ssrs-reportviewer";
// Many other imports

@NgModule({
  declarations: [
    AppComponent,
    // Many other components
  ],
  imports: [
    ReportViewerModule,
    // Many other modules
  ],
  providers: [//Services here],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {
 }

这是组件的包版本:

Angular CLI: 1.6.0
Node: 12.13.0
OS: win32 x64
Angular: 5.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/cli: 1.6.0
@angular/elements: 10.0.4
@angular/language-service: 4.4.6
@angular/material: 5.2.0
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0

@webcomponents/custom-elements: ^1.4.2
ngx-ssrs-reportviewer: ^2.0.7

有谁知道我怎样才能让这个包在项目上工作,或者有什么其他的替代品可以用来在 web 应用程序上显示报告?

标签: angularreporting-services

解决方案


推荐阅读