Page 1 of 1

toolbar not working on Angular 8

Posted: Thu Nov 12, 2020 5:24 pm
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);
                }
            );
    }

Re: toolbar not working on Angular 8

Posted: Fri Nov 13, 2020 7:06 am
by Lech Kulikowski
Hello,

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

Thank you.

Re: toolbar not working on Angular 8

Posted: Fri Nov 13, 2020 2:49 pm
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.

Re: toolbar not working on Angular 8

Posted: Mon Nov 16, 2020 11:00 am
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

Re: toolbar not working on Angular 8

Posted: Wed Nov 18, 2020 9:02 am
by Lech Kulikowski
Hello,

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

Thank you.
#3034

Re: toolbar not working on Angular 8

Posted: Fri Nov 20, 2020 7:25 am
by Lech Kulikowski
Hello,

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

Thank you.

Re: toolbar not working on Angular 8

Posted: Fri Nov 20, 2020 11:28 am
by adrianareigadas
Thank you!

Re: toolbar not working on Angular 8

Posted: Fri Nov 20, 2020 12:58 pm
by Lech Kulikowski
Hello,

You are welcome.