Hoppa till huvudinnehållet

In the Run Report activity, how to use the "Data Sources" input?

Kommentarer

1 kommentar

  • Chris Dunlop

    OK, figured it out, with help from a Geocortex video (https://www.youtube.com/watch?v=I42f29HnqcA). It works using a JSON data source, which is available in Reporting 5.13 on. Here's what I did, to get it working:

     

    In Reporting, I set up a JSON Data Source. I called it jsonTest, and used the following json template code:

     

    {

      "features":[

       {

         "attributes":{

          "TAXPAYER":"sample"

         }

       }

      ]

    }

     

    In my report I then added jsonTest as a data source, and specified the Root element to be root.features. This added the datasource as jsonDataSource1 to the report, which gives access to jsonDataSource1.attributes.TAXPAYER. I added a label control to my detail band, and in the Expressions properties, I set its Layout>Text to [attributes.TAXPAYER]. If I preview the report, it correctly shows a single label with the text "sample" (this is from the data source JSON code above). Saved the report.

     

    In Workflow, I added a Run Report activity. The Data Sources input looks like this:

     

    ={

    "name":"jsonTest",

    "value":{

    "features":[

    {

    "attributes":{

    "TAXPAYER":"Nigel Tufnel"

    }

    },

    {

    "attributes":{

    "TAXPAYER":"David St. Hubbins"

    }

    },

    {

    "attributes":{

    "TAXPAYER":"Derek Smalls"

    }

    }

    ]

    }

    }

     

     

    Note that the "name" item is set as "jsonTest", not jsonDataSource1.

     

    The report now correctly displays the JSON data sent from the workflow :-)

     

    0

Du måste logga in om du vill lämna en kommentar.