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??
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
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
Thanks! I've fixed it
Appreciate your support
Hello again!
Thank you for the quick response.
We are glad to hear that our solution was helpful.
Feel free to contact us if any other questions arise.
Best regards,
Solomiia