Using a parameter to populate a table in reporting

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.

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

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.
This dataset tag is a client tag, does that have anything to do with it?

this is the data in the tag

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.

3 Likes

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.

1 Like

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

1 Like

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

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)

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?

Try using the regular table instead of the simple table:

https://docs.inductiveautomation.com/display/DOC80/Report+-+Table

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?

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