Generate Report from Data on a View

I have a view that currently gives a detailed summary table for devices on a job with a lot of data. I want to set up a button that will open a popup with a report viewer. This report should be able to take all the information from the table and essentially just reformat it to a more printer/pdf friendly version of the table with all its associated data. But I'm having trouble figuring out how to have the main view table pass data into the popup, then have that popup pass the data into a report.

I wouldn't pass the actual data into the popup or report. I would just pass the parameters needed to recreate the data within the report (i.e. parameters to the named query that created the data).

2 Likes

I was able to pass the parameters from the main view into the popup view, but I can't figure out how to get the data from the main view table into the report. The table was generated through an expression script, because all of the data is being pulled from UDT tags and filtered, rather than coming from a query. But I can't connect the report table directly to the UDT tags because I need it in that already filtered form. I tried pasting the same script from the main view table into a script data source on the report template, but that threw all sorts of errors back at me.

Instead of copy/pasting the script, I would implement it as a library function that can be invoked from any location. Assuming you pass it the same parameters, you'll get the same results.

It's a good idea in general to do this instead of a script transform, as you can invoke it using a runScript() expression, which executes quicker than a transform.

1 Like