gagarin Posted August 8, 2018 Share Posted August 8, 2018 HelloI'm creating a report using two datasources (the format is JSON).The structure of JSON is like:{ "first": { "parameter1" : 123, }, "second":[ { "key" : 1, },{ "key" : 2, } ]}[/code]So I have two datasources. One for the first object (firstSource) and another (secondSource) for second object (array of objects).The array (second) is printed in the table component. I'd like to access a field from first object (first.parameter1) and print it in the table header.The table is using this dataset:<datasetRun uuid="4ee63b06-f4ee-45b4-9da8-3dabc3e7a09d"> <dataSourceExpression><![CDATA[$P{secondSource})]]> </dataSourceExpression></datasetRun>[/code]Then I'm printing its fields using $F{key}.Do you know how can I access the parameter1 of the first object from table? Maybe using some sort of $V{} variable or merging both datasources?I tried to use subDataSource and subDataSet approach without any luck.Here's something I'd like to achieve in the result table:first.parameter1second[0].keysecond[1].key Link to comment Share on other sites More sharing options...
narcism Posted August 9, 2018 Share Posted August 9, 2018 Why not have the whole JSON data populating the main data source? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now