# Using a parameter to populate a table in reporting

**URL:** <https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287>\
**Category:** Ignition\
**Created:** [December 7, 2018, 3:01pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287 "2018-12-07T15:01:03Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 7, 2018, 3:01pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/1 "2018-12-07T15:01:03Z")

</div>

> [@Generating a report from window components](http://forum.inductiveautomation.com/t/generating-a-report-from-window-components/20332/2):
>
> Assuming you are using the Report Viewer component on a vision window, yes you can bind a report parameter with a dataset type to the data property of a dropdown list.

I'm having trouble using a dataset tag as the source for a table component in the reporting module. I haven't found any examples in manual about doing this. The dataset is a parameter in my report, from what I've read, I need to put in a scripting datasource to get it in the table, but it isn't working.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0ef68850660e6c6aa7c35cf0f0488e0cbd4856c7.png)

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [December 7, 2018, 3:22pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/2 "2018-12-07T15:22:40Z")

</div>

What isn’t working? Are you receiving an error?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 7, 2018, 3:26pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/3 "2018-12-07T15:26:30Z")

</div>

No errors, but ‘myData’ under Data Sources doesn’t have any keys listed under it, therefore the table I dropped it in is totally blank. ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e1780322b278683b6b0d0509f92a4e35b5163eff.png)  
This dataset tag is a client tag, does that have anything to do with it?  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/483c0b45ec88dc0035013c068b0d711930261f16.png)  
this is the data in the tag

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8651e9234020fb4a0c967821a6c3ed12c3b76686.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 7, 2018, 3:41pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/4 "2018-12-07T15:41:18Z")

</div>

> [@dkhayes117](#):
>
> This dataset tag is a client tag, does that have anything to do with it?

Yup. Reports run on the gateway -- they don't have any access to client tags, except where you bind the client tag to a report viewer's parameter.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 7, 2018, 3:42pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/5 "2018-12-07T15:42:40Z")

</div>

Hmmm, reports are generated on the gateway, I guess my client tags are the problem. This should be fine if I use system.tag.read to get my client tags and pass them in for parameters with executeAndDistribute. It’s just a pain to design the report to begin with. I guess I will have to create gateway tags to design the report, then delete them.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 7, 2018, 3:48pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/6 "2018-12-07T15:48:35Z")

</div>

I was able to create some gateway tags to design with, and they are working as I expected. Thanks @pturmel @ethomason

---

<div class="post-metadata">

**Author:** ![john.eichler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/john.eichler/32/24632_2.png) [@john.eichler](https://forum.inductiveautomation.com/u/john.eichler)\
**Post date:** [August 3, 2021, 6:19am UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/7 "2021-08-03T06:19:39Z")

</div>

Hi.

I would like to print a report showing a table populated with a dataset. I have passed the dataset to the report as a parameter and set this up as a data source using the screenshot above.

I can now display rows of the dataset in a simple table using [@data[rowNumber].columnName@]. Is there a better method than individually addressing all the elements? I was hoping I could point the dataset at a table and it would just work! My current solution is OK but since the dataset is of variable length, I will get N/A for empty cells.

Any ideas?

Thanks

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/f/8f31beb51c09ba24bf325b5fc5cbb2bc1f816941.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a34bed5f071997191ff334b56256d866ecefecd6.png)

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [August 3, 2021, 12:03pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/8 "2021-08-03T12:03:48Z")

</div>

You shouldn’t have to address each element, the table should be dynamic to the data source.  
[Report - Simple Table - Ignition User Manual 8.0 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC80/Report+-+Simple+Table)

---

<div class="post-metadata">

**Author:** ![john.eichler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/john.eichler/32/24632_2.png) [@john.eichler](https://forum.inductiveautomation.com/u/john.eichler)\
**Post date:** [August 3, 2021, 8:18pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/9 "2021-08-03T20:18:43Z")

</div>

Thanks. I read the documentation about the simple table but I was unable to get it to work with my dataset.

In the data configuration area, I have set up a script that copies my input **parameter** (dataset) to a datasource called “Loading”.

data[‘loading’]=data[‘data’]

I added a simple table and set the data key to my datasource “Loading” but the the table is blank at runtime. I know the data is there because the individual addressing works.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 3, 2021, 8:30pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/10 "2021-08-03T20:30:27Z")

</div>

Try using the regular table instead of the simple table:

[https://docs.inductiveautomation.com/display/DOC80/Report+-+Table](https://docs.inductiveautomation.com/display/DOC80/Report+-+Table)

---

<div class="post-metadata">

**Author:** ![john.eichler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/john.eichler/32/24632_2.png) [@john.eichler](https://forum.inductiveautomation.com/u/john.eichler)\
**Post date:** [August 3, 2021, 10:24pm UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/11 "2021-08-03T22:24:31Z")

</div>

I tried the normal table but this gives the same result. Do I need to modify the script that copies the dataset to the data source?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 4, 2021, 12:44am UTC](https://forum.inductiveautomation.com/t/using-a-parameter-to-populate-a-table-in-reporting/21287/12 "2021-08-04T00:44:37Z")

</div>

Can you post the entire script?  
Also a screenshot of how you have the table setup.
