Get Free Trial

How to give data to report in FlexMonster

Re-Open
Osama Ameer asked on June 20, 2022

I am unable to load data which I am fetching from my nodejs server and passing it to report. The same thing I am able to do in html. Kindly response.
report: {
                 dataSource: {
                         /* URL to the Data Compressor Node.js */
                        // filename: “http://localhost:5000/”,
                        data:res.recordset
                    },
                   }
I did this in html, how can I do this in react?? 

3 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 21, 2022

Hello, Osama!
 
Thank you for your question.
 
Here are some steps on how to connect Flexmonster to your local server using React framework:
 
1. Define the report in React component class. 
Kindly note you can use the filename property to specify the server endpoint, which returns the JSON data from your local server as follows:

report = {
      dataSource:{
            type:"json", 
            filename:"http://localhost:5000/"
      },
      ...
}

2. Add the report to the Flexmonster component as follows:

<FlexmonsterReact.Pivot  
  ref="pivot"  
  report={this.report}
  />

Kindly note that we used the JSON format in the example above, but the server can return CSV data as well.
 
To find more details on the React integration, please look through our sample project: https://github.com/flexmonster/pivot-react.
 
We hope it helps. Feel free to contact us in case of any other questions.
 
Regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster about 1 hour ago

Hello, Osama!

Hope you are doing well.

Our team is wondering if you had some time to check the suggested approach on embedding Flexmonster into the React application. Could you please let us know if it was helpful?

Looking forward to your response.

Regards,
Solomiia

Public
Osama Ameer 42 mins ago

Thanks! I’ve fixed it
Appreciate your support

Please login or Register to Submit Answer