cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Is it possible to create a direct link to a chart replacing the default query for the Chart?

phartwig
12-Amethyst

Is it possible to create a direct link to a chart replacing the default query for the Chart?

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

3 REPLIES 3

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.

mrump
14-Alexandrite
(To:mrump)

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.

Top Tags