Page 1 of 1

Array of objects as data source

Posted: Sat Jul 20, 2019 2:22 pm
by jhiben
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.

Re: Array of objects as data source

Posted: Mon Jul 22, 2019 7:00 am
by Lech Kulikowski
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.

Re: Array of objects as data source

Posted: Mon Jul 22, 2019 10:26 am
by jhiben
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?

Re: Array of objects as data source

Posted: Wed Jul 24, 2019 7:20 am
by Lech Kulikowski
Hello,

Unfortunately, no, there are no other ways. Sorry.

Thank you.

Re: Array of objects as data source

Posted: Sun Aug 04, 2019 3:18 pm
by jhiben
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.

Re: Array of objects as data source

Posted: Mon Aug 05, 2019 8:21 am
by Lech Kulikowski
Hello,

Thank you for the provided information.