In the Run Report activity, how to use the "Data Sources" input?
Hello. I'm trying to figure out the correct syntax of the Data Sources input of the Run Report activity. I have a report that has a data source called sqlDataSource1, which points to a single table, TAXLOTS, which has a single field "TAXPAYER". There is a single label control on the detail band of the report that is set to [TAXPAYER].
I'd like to pass a list of three taxpayers into my report, Nigel Tufnel, David St. Hubbins, and Derek Smalls. Can anyone help me with the syntax to send these names via the Data Sources input?
Thanks!
Chris
-
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
Please sign in to leave a comment.
Comments
1 comment