toolbar not working on Angular 8

Stimulsoft Reports.JS discussion
Post Reply
adrianareigadas
Posts: 5
Joined: Thu Nov 12, 2020 5:06 pm

toolbar not working on Angular 8

Post by adrianareigadas »

Hi,
I am trying to use stimulsoft viewer in our Angular 8 website. We have a node server that gets the mrt template files, renders them and return a XML file.
Our angular website should be able to read the xml (like a mdc file) and show the report.

I managed to show the report but the toolbar is not working. My code

package.json

Code: Select all

"dependencies": {
    "stimulsoft-reports-js": "^2020.4.2-c",
    ..
   },
   ...
  "browser": {
    "fs": false
  }
HTML template

Code: Select all

<app-content class="pdf-viewer">
  <div id="stimulsoft-viewer"></div>
</app-content>
Typescript

Code: Select all

   constructor(
        private userService: UserService,
        private reportsService: ReportsService
    ) {
        this.stimulsoftInit();
    }
    
    stimulsoftInit() {
        Stimulsoft.Base.StiLicense.key = environment.stimulsoft_key;

        const options = new Stimulsoft.Viewer.StiViewerOptions();
        options.appearance.showTooltips = false;
        options.toolbar.showDesignButton = false;
        options.toolbar.showAboutButton = false;
        options.toolbar.showOpenButton = false;

        this.viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false);
        this.report = new Stimulsoft.Report.StiReport();
    }
    
    runViewer() {
        this.loading = true;
        this.viewer.report = null;

        this.reportsService.downloadReport(this.selectedReport, this.form.getRawValue())
        this.reportsService.downloadReport(this.selectedReport,  this.form.getRawValue())
            .pipe(finalize(() => this.loading = false))
            .subscribe(
                (response: HttpResponse<Text>) => {
                    const data = response.body;

                    this.report.loadDocument(data);
                    this.viewer.report = this.report;

                    this.viewer.renderHtml('stimulsoft-viewer');
                },
                error => {
                    console.log(error);
                }
            );
    }
Lech Kulikowski
Posts: 6266
Joined: Tue Mar 20, 2018 5:34 am

Re: toolbar not working on Angular 8

Post by Lech Kulikowski »

Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.
adrianareigadas
Posts: 5
Joined: Thu Nov 12, 2020 5:06 pm

Re: toolbar not working on Angular 8

Post by adrianareigadas »

I will try to generate a sample project. In the meantime, should it work on Angular 8+? Is there any example?

Thank you.
adrianareigadas
Posts: 5
Joined: Thu Nov 12, 2020 5:06 pm

Re: toolbar not working on Angular 8

Post by adrianareigadas »

[attachment=0]stimulsoft-angular.zip[/attachment]Hi,

This is a simple angular project using stimulsoft-reports-js.
It loads the report but the toolbar does not work. Could you please let me know how to fix that?

Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1100.1
@angular-devkit/build-angular 0.1100.1
@angular-devkit/core 11.0.1
@angular-devkit/schematics 11.0.1
@angular/cli 11.0.1
@schematics/angular 11.0.1
@schematics/update 0.1100.1
rxjs 6.6.3
typescript 4.0.5
Attachments
stimulsoft-angular.zip
Angular and Stimulsoft-reports-js
(580.03 KiB) Downloaded 137 times
Lech Kulikowski
Posts: 6266
Joined: Tue Mar 20, 2018 5:34 am

Re: toolbar not working on Angular 8

Post by Lech Kulikowski »

Hello,

We need some additional time to investigate the issue, we will let you know about the result.

Thank you.
#3034
Lech Kulikowski
Posts: 6266
Joined: Tue Mar 20, 2018 5:34 am

Re: toolbar not working on Angular 8

Post by Lech Kulikowski »

Hello,

Styles were not loaded.
https://stackoverflow.com/questions/463 ... 4/46363503

Thank you.
adrianareigadas
Posts: 5
Joined: Thu Nov 12, 2020 5:06 pm

Re: toolbar not working on Angular 8

Post by adrianareigadas »

Thank you!
Lech Kulikowski
Posts: 6266
Joined: Tue Mar 20, 2018 5:34 am

Re: toolbar not working on Angular 8

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply