Back to forum

how to refresh the report on Angular 6

Resolved

I used your example from GitHub (https://github.com/WebDataRocks/pivot-angular/tree/master/src/app).

<wbr-pivot #pivot1 [toolbar]=”flag”
[width]=”‘100%'”
[height]=”500″
[report]=”getReport()”>

I need to set the [report] after a asynchronous request http.get(). 
I used a getReport() method for return the data to [report], but when the component wbr-pivot is initiated the http request still don’t ended and the getReport() method return a data empty;

 
So, I need to set the [report]  and refresh the component. how to do that?

2 answers

WebDataRocks Team WebDataRocks November 29, 2018

Hello,
 
Thank you for the question.
The correct sequence for your case is:

  1. Initialize the empty pivot and wait for ready event
  2. Create a HTTP get request to the report and wait for the JSON response
  3. Use `this.child.webDataRocks.setReport()` API method to set the report 

Please let us know if it helps.
 
Regards,
WebDataRocks Team

izaltino December 4, 2018

I used your exemple from https://github.com/WebDataRocks/pivot-angular/blob/master/src/app/app.component.ts.
and now I understand what I should do.
thanks for helping!

Move up