Display hierarchical JSON

Posted by: gabriel.bojan on 18 September 2018, 7:22 am EST

    • Post Options:
    • Link

    Posted 18 September 2018, 7:22 am EST

    Hi!

    I have a JSON data source, 2 levels deep (array of records and each record has an array of details). Here is a simple example:

    
    {
      "JustText": "Some text",
      "Records": [
        {
          "DataRecordID": 1,
          "Name": "first record",
          "Details": [
            {
              "DetailRecordID": 100,
              "Value": "peanuts"
            },
            {
              "DetailRecordID": 110,
              "Value": "cactus"
            }
          ]
        },
        {
          "DataRecordID": 2,
          "Name": "second record",
          "Details": [
            {
              "DetailRecordID": 200,
              "Value": "red"
            }
          ]
        },
        {
          "DataRecordID": 3,
          "Name": "third record",
          "Details": [
            {
              "DetailRecordID": 300,
              "Value": "hot"
            },
            {
              "DetailRecordID": 310,
              "Value": "cold"
            }
          ]
        }
      ]
    }
    
    

    The output I want is this:

    • 1st page shows a table of “Records” from above:

      “1” “first record”

      “2” “second record”

      “3” “third record”

    • next I want one page for each record and also display a table with the record details. Some records could span more than one page based on how much details they have. So page 2 would look like this:

      “1” “first record”

      Details:

      “100” “peanuts”

      “110” “cactus”

    • Page 3:

      “2” “second record”

      Details:

      “200” “red”

    • Page 4:

      “3” “third record”

      Details:

      “300” “hot”

      “310” “cold”

    The first page is easy to do but I do not know how to create the record detail pages. I tried both rdl and page report types without success. Any help is appreciated.

    Thank you.

  • Posted 18 September 2018, 7:21 pm EST

    Hello Gabriel,

    I would suggest you use the “SubReport” to pass the “Parameter” in the subreport according to “Name” field. Please refer to the attached report to implementing the same.

    Hope it helps.

    Thanks,

    rpt_Jsonm.zip

  • Posted 19 September 2018, 1:57 am EST

    Thank you very much mohitg.

    The example you provided works. I will try to figure out the details.

  • Posted 19 September 2018, 2:13 am EST

    Gabriel,

    Take your time and in case of any problem, please do contact us again.

    Thanks,

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels