Merge Datasets

Stimulsoft Reports.JS discussion
Post Reply
alex.coles
Posts: 14
Joined: Mon Feb 03, 2020 2:19 pm

Merge Datasets

Post by alex.coles »

I have an API which I am passing to Reports twice with different parameters, so have 2 different datasources in my report in the format:

Code: Select all

[
  { 'id': 1, 'value':3 },
  { 'id': 2, 'value':4 },
  { 'id': 4, 'value':2 }
]

Code: Select all

[
  { 'id': 2, 'value':5 },
  { 'id': 3, 'value':1 },
  { 'id': 4, 'value':3 }
]
What I want is to output the two datasets merged into a databand similar to:

Code: Select all

Item	V1	V2	Dif
1     	3	0	-3
2     	4	5	1
3	0	1	1
4	2	3	1
Looking for some way of creating a merged dataset, any ideas? Is this possible?

Stimulsoft.Reports.JS
Version: 2019.4.2
Build date: 2019.11.13
Stimulsoft.Reports.JS - Version: 2019.4.2 - Build date: 2019.11.13
Lech Kulikowski
Posts: 7292
Joined: Tue Mar 20, 2018 5:34 am

Re: Merge Datasets

Post by Lech Kulikowski »

Hello,

You can try to use the DataTransformation item.
But each data source should contain all id from both sources.

Thank you.
Attachments
33.mrt
(16.05 KiB) Downloaded 160 times
Post Reply