Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
All,
I am looking for a way to create a hyperlink to a chart that replaces the defined query of the chart with one I specify. I can successfully call a chart using this format: http://{hostname}{port}/im/runchart?selection={chartname} and I can call a report replacing the query with this call : http://{hostname}:{port}/im/runreport?queryDefinition=(field[ID]={id})&selection={reportname}. Is there a different format for the call that I need to use for the Chart or is this unsupported?
Thank you,
Paul Hartwig
Paul, you should be able to use these options, to override the query, for a chart (even via a Web URL):
1. --query Override chart query with this query at run time.
2. --queryDefinition Override chart query with this query definition at run time.
Make sure you're putting this after the selection option and value, in your runchart URL/call. It may be getting confused with that.
this call : http://{hostname}:{port}/im/runreport?selection={reportname}&queryDefinition=(field[ID]={id})
or for charts
this call : http://{hostname}:{port}/im/runchart?selection={chartname}&queryDefinition=(field[ID]={id})
works fine for us.
UPDATE: for PTC version > 12.x and higher
the API is now more restrictive regarding special character encoding.
Therefore the braces '[' ( == %5B) and ']' (==%5D) have to replaced as well as the '=' (== %3D) in the queryDefinition
so to
run a report
this call : http://{hostname}:{port}/im/runreport?selection={reportname}&queryDefinition=(field%5BID%5D%3D={id})
or to run a chart
this call : http://{hostname}:{port}/im/runchart?selection={chartname}&queryDefinition=(field%5BID%5D%3D={id})
works fine for us.