Add Custom Function to Sti report

Stimulsoft Reports.NET discussion
Post Reply
Abed Hamodi
Posts: 19
Joined: Wed May 18, 2016 9:55 am

Add Custom Function to Sti report

Post by Abed Hamodi »

hello
how can i add custom function to my sti report ?

thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Add Custom Function to Sti report

Post by Alex K. »

Hello,

please see the following video:
https://www.youtube.com/watch?v=TEYuQmia9IY

Thank you.
Abed Hamodi
Posts: 19
Joined: Wed May 18, 2016 9:55 am

load stimual designer report from josn string in angular 4

Post by Abed Hamodi »

hello ,
how can load stimual designer report from josn string in angular 4

the error occur in this method SetData

SetData() {

this.designer = new Stimulsoft.Designer.StiDesigner(this.options, 'StiDesigner', false);
this.designer.report = new Stimulsoft.Report.StiReport();
this.designer.report.load(this.josnData);
this.designer.renderHtml('designer');

}

and this mehtod call after SaveData()

SaveData() {
var json = this.designer.report.saveDocumentToJsonString();

this.josnData = json;

}




Please see all code

import { Component } from '@angular/core';
import { ViewEncapsulation } from '@angular/core';
import { Headers} from '@angular/http';
import {Observable}from 'rxjs';
import {Injectable} from '@angular/core';
import { Http } from '@angular/http';


declare var Stimulsoft: any;
@Injectable()
@Component({
selector: 'app-root',
template: `<div>
<h2>Stimulsoft Reports.JS Designer</h2>
<div id="designer"></div>
</div>
<button (click)="SaveData()">SaveData</button><button (click)="SetData()">SetData</button>
`
})
export class AppComponent {
options: any;
designer: any;

ngOnInit() {


this.options = new Stimulsoft.Designer.StiDesignerOptions();
this.options.appearance.fullScreenMode = false;


this.designer = new Stimulsoft.Designer.StiDesigner(this.options, 'StiDesigner', false);


this.designer.report = new Stimulsoft.Report.StiReport();


this.designer.renderHtml('designer');


}

constructor(private _http: Http) {
}





josnData:string;
SaveData() {
var json = this.designer.report.saveDocumentToJsonString();

this.josnData = json;

}

SetData() {

this.designer = new Stimulsoft.Designer.StiDesigner(this.options, 'StiDesigner', false);
this.designer.report = new Stimulsoft.Report.StiReport();
this.designer.report.load(this.josnData);
this.designer.renderHtml('designer');

}




}
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Add Custom Function to Sti report

Post by Lech Kulikowski »

Hello,

You can find samples at the following link:
https://github.com/stimulsoft/Samples-JS

Thank you.
Post Reply