Export tag history data in PDF format

Hi guys, may I know what is the best way to export the tag history data in pdf format.

Some questions:

  • The raw values or a trend line?
  • Automatically export on a schedule or enable a user to export when there’s something they want to save?
  • Vision or Perspective or neither? (This is potentially related to the above question)

For user interaction, there are components in both vision and perspective that will let you print a trend line or export the data to a file (Easy Chart For Vision, Power Chart for Perspective).

To export the data automatically on a schedule, the Reporting module has a ‘Tag Historian Query’ data source. Reports can then be emailed as a PDF or saved to a network file location.


Hi @zacht thanks for your reply.

  1. I would like to export the raw values which including the timestamp, floatvalue and etc

  2. Automatically or manually export by the users also can

  3. It is a Perspective project

  4. Yaa, I know that the perspective do have Power Chart but this chart only able to export the raw value in csv file or print the trend line only.

  5. For Tag Historian Query I had try it last time but it cant work for me. May I know that do you have any example ?

Thanks a lot bro.

If you want to export both ways (scheduled and event driven), I think your best bet is to make a report that shows the info you want. You can schedule this the regular way using reports, you can run the report on a button click through scripting, and you can display the custom report in a perspective Report Viewer component.

As for how to structure the historian query, I made a quick mock up using these settings. I didn’t change anything in the ‘Advanced’ section, but you may want to depending on the nature of your data.


With these settings and the table properly set up the report looks like this. It could be improved with some better formatting, but I think it works as a proof of concept for what you’re trying to do.

@zacht Thanks for your help.
One more question from me. May I know that It is possible to let the users to choose the start date and end date by themselves which means the users will input the start date and end date they want then the table will filter all the data based on the users input.

Another questions is It is possible to pass the parameters from the Perspective Page to Report modules ?

Thanks in advance. Have a nice days.

For viewing the report on a screen this is pretty easy. You accomplish this by passing parameters from a perspective page exactly as you suggest. The default report starts with two parameters, StartDate and EndDate. You have to create objects in the params section of the report viewer component with the same names as your report parameters (as shown in the picture below). Bind these to any date source (there are several components that would work depending on your graphical preference), and everything should work. One note of caution, when you first create the objects in props.params, it will look like your report is broken because the parameter values have the wrong type. Put valid sample values in and everything should work like it’s supposed to.


For the export the process is similar. In system.report.executeAndDistribute you can pass parameters as strings. Get the values from your date picker components (or create the dates based on some logic you prefer) and pass them as parameters in the function call.