Report Tag Historian Query ( Start Date and End Date )

We have a report where all data is retrieved by using named query - operator has to supply batch number and then SQL query reads required data. Among retrieved data we have batch start time and batch end time. I would like to use these as a start/end date binding for a tag history query in the same report (for timeseries chart). But tag history query only accepts report parameters for start/end date binding.
How do I get query data to parameters ? Can I use the script to write directly to report parameters, or should I write to tags then bind parameters to tags ? Or write directly to chart object parameters ?

Vision or Perspective? (Add a tag to your question.)

For Vision you could store the timestamps in client tags.
For Perspective you could store the timestamps in session variables.

You can then bind the start and end dates to those variables.

{ It is not strictly Vision or Perspective. It is a Report. }

If you have only one returned row for your Batch information, you could use a script data source to obtain those fields and save them in the data dictionary as stand-alone parameters.

However, it is probably visually easier to simply make a nested query–the nested query can use outer field names as parameters.

My chart parameters and data sources

I can bind start/end date only to parameter - not directly to tag or to data key

And parameter can only by connected to tag.

I have tried following:

  • writing to parameters does not work, or maybe I am writing to them incorrectly
  • data keys are not accessible for binding directly to range in tag history query or to parameters
  • writing to tags and binding parameters to tags (and then tag history query range to parameters) kind of work, except that tags updates AFTER batch report is executed and trend data range is from previously executed report.
	# Write to parameters
	ChartStartDT = rawDataset.getValueAt(0,'BATCH_START_DT_TREND')
	ChartEndEndDT = rawDataset.getValueAt(0,'BATCH_END_DT_TREND')
	# Write to data keys
	data['TrendStart'] = rawDataset.getValueAt(0,'BATCH_START_DT_TREND')
	data['TrendEnd'] = rawDataset.getValueAt(0,'BATCH_END_DT_TREND')	
	# Write to tags
	system.tag.writeBlocking ("[MX01]REPORTING/SF_BR_TREND_START_DT",rawDataset.getValueAt(0,'BATCH_START_DT_TREND'))
	system.tag.writeBlocking ("[MX01]REPORTING/SF_BR_TREND_END_DT",rawDataset.getValueAt(0,'BATCH_END_DT_TREND'))

So I guess I will have to supply tag history range to parameters before executing report.
Not a big issue, I was just hoping to do that from report itself.

Click on your br_query. Then, over on the right hand side of the designer, create your tag_history query as a nested query under the br_query.

Yes for SQL query but not for Tag Historian query ?