Hi,
I'm working on a report which needs to load some arbitrary data. I've prepared the report template with ASP.NET Core and configured several business objects that I load into the report when I want to view/render it.
However, when I tried to use this template with the JS library, nothing was working anymore (even though there is a regbusinessobject function on the report object). I've checked this forum and some posts clearly indicate that business objects are not supported in the JS library.
So here is my question: what is the best way to load an array of custom objects in a report with the JS library ? I need the final template to be compatible with the JS and the .NET Core libraries (that is, to be able to render the report on both the browser and the server).
Thanks in advance for your help.
Array of objects as data source
-
- Posts: 6265
- Joined: Tue Mar 20, 2018 5:34 am
Re: Array of objects as data source
Hello,
Unfortunately, business objects are not supported in the JS version.
As a way, you can try to implement your own custom adapter. You can find a sample at the following link:
https://github.com/stimulsoft/Samples-J ... apter.html
Thank you.
Unfortunately, business objects are not supported in the JS version.
As a way, you can try to implement your own custom adapter. You can find a sample at the following link:
https://github.com/stimulsoft/Samples-J ... apter.html
Thank you.
Re: Array of objects as data source
Thank you for your answer.
So, just to be sure, there is no built-in way to load an array of objects in a report with the JS library?
So, just to be sure, there is no built-in way to load an array of objects in a report with the JS library?
-
- Posts: 6265
- Joined: Tue Mar 20, 2018 5:34 am
Re: Array of objects as data source
Hello,
Unfortunately, no, there are no other ways. Sorry.
Thank you.
Unfortunately, no, there are no other ways. Sorry.
Thank you.
Re: Array of objects as data source
All right, thanks.
For the record, I have finally found a solution that works on both side, using a DataSet: in JS, the Stimulsoft library contains an implementation that can load some JSON, and in .NET one can easily convert an object to a System.Data.DataSet (using JsonConvert for example). This dataset can then be used as a DataSource in the report.
For the record, I have finally found a solution that works on both side, using a DataSet: in JS, the Stimulsoft library contains an implementation that can load some JSON, and in .NET one can easily convert an object to a System.Data.DataSet (using JsonConvert for example). This dataset can then be used as a DataSource in the report.
-
- Posts: 6265
- Joined: Tue Mar 20, 2018 5:34 am
Re: Array of objects as data source
Hello,
Thank you for the provided information.
Thank you for the provided information.