Data source for polymorphic data

Stimulsoft Reports.JS discussion
Post Reply
lega
Posts: 10
Joined: Mon May 29, 2017 12:44 pm

Data source for polymorphic data

Post by lega »

Hello guys,

Here's our problem. If I create data set using the following object

Code: Select all

let jsonObj = {
	items: [
	{
		prop1:"...",
		prop2:"..."
	},
	{
		prop1:"...",
		prop3:"..." // this prop doesn't existing in the first item
	}]
}
The designer would recognize and display only properties form the first item ignoring the rest. The only way we've found to design report for all possible item types is by putting item of each type
first, one by one. It might be an OK option for one time edit, but would be really annoying to do this on regular basis.

The only option I see is to merge all item objects into one and pass to readJson. But this means we screw up the preview, since the first item is a mutant type composed of all possible item types.

Is there a way to provide data and schema separately? Or maybe there's another solution. Will appreciate anything that'd help.

Thanks!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Data source for polymorphic data

Post by Alex K. »

Hello,

We couldn't reproduce this bug.
Please try to check the last release build.

Thank you.
Attachments
Capture.PNG
Capture.PNG (54.23 KiB) Viewed 2075 times
Capture.PNG
Capture.PNG (85.85 KiB) Viewed 2075 times
lega
Posts: 10
Joined: Mon May 29, 2017 12:44 pm

Re: Data source for polymorphic data

Post by lega »

Hi Alexey,

Thanks a lot, I must be did something wrong. It works fine now. Sorry for that!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Data source for polymorphic data

Post by Alex K. »

Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.
Post Reply