Using Viewer Parameters
Our sample projects and report templates can help you learn the basics of working with our products.The viewer can be driven from your application through a properties object bound to the component.
Client side. Store the available reports and the current
The
Client side. Store the available reports and the current
properties object in the component, and update it when the selection changes:export class AppComponent {
reports = ['MasterDetail.mrt', 'EditableReport.mrt'];
properties = { reportName: this.reports[0] };
updateProps(reportName: string): void {
this.properties = { reportName };
}
}<select (change)="updateProps($event.target.value)">
<option *ngFor="let item of reports" [value]="item">{{ item }}</option>
</select>
<stimulsoft-viewer-angular
[requestUrl]="'/Viewer/{action}'" [action]="'InitViewer'" [height]="'100vh'"
[properties]="properties">
</stimulsoft-viewer-angular>The
properties object is a bag of values the client shares with the server; here it carries a single field, reportName. Selecting an item assigns a new object (so Angular detects the change), and the viewer sends it to the server, where the controller loads the matching template.