I am using:
- The Stimulsoft Designer npm package for Angular in my frontend app
- The Stimulsoft.Reports.Angular.NetCore for .NET 8 with my backend API
In the viewer component for Angular I see that I might be able to do this via the "properties" input for the init action that I specify, but I have no idea how to do it in the designer. I also tried using the "postParametersFunction" parameter to specify the report at a later point during the designer/report template loading process, but the function seems to never get called. Below is a snippet of my front-end code where I try to add a report id parameter into post parameters and debug to check if the function got called.
Component template:
Code: Select all
<stimulsoft-designer-angular
#designer
[requestUrl]="'https://localhost:7400/StiDesigner'"
[height]="'100vh'"
[width]="'100vv'"
[postParametersFunction]="getPostParameters"
(designerLoaded)="
this.designer.designerEl.nativeElement.style.height = '100%'">
</stimulsoft-designer-angular>
Code: Select all
import { Component, ElementRef, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { RoutesService } from '@dgc.web/ui';
import { DgcWebRoutes } from '../../../primitives/dgc-web-routes';
import { map } from 'rxjs';
import { StimulsoftDesignerComponent } from 'stimulsoft-designer-angular';
@Component({
selector: 'dgc-report',
templateUrl: './report-designer.component.html',
styleUrls: ['./report-designer.component.scss'],
})
export class ReportDesignerComponent {
@ViewChild('designer') stiDesigner: ElementRef<StimulsoftDesignerComponent> | undefined
public reportId: string | null = null;
constructor(
private _route: ActivatedRoute,
public router: Router,
private _routerService: RoutesService<DgcWebRoutes>) {
this._route.paramMap
.pipe(map(params => params.get('id')))
.subscribe(id => {this.reportId = id});
}
public getPostParameters(data: any): any {
console.log("get post parameters executed");
return { reportTemplateId: this.reportId };
}
}
I would be really grateful for some help/direction on this, because without the ability to specify what report should be called from outside Stimulsoft, I'm not sure how to proceed.