QPR Knowledge Base 2014.1

GetGraphAsStream

GetGraphAsStream

Previous topic Next topic  

GetGraphAsStream

Previous topic Next topic JavaScript is required for the print function  

Revision history:

Introduced in QPR 8.1

Last changed in QPR 8.2

 

Returns a graph image from an element defined in the function call. With parameters you can define the type and attributes of the fetched graph.

 

Synopsis:

 

Stream GetGraphAsStream(string sessionId, string objectId, string options)

 

Return Value:

 

Graph as a Stream object.

 

Parameters:

 

sessionId: String. ID of an authenticated session.

objectId: String. ID of an object from which a graph is fetched.

options: String. List of comma-separated attributes:

GraphType:

oPG

oprocesslevel (default): Returns a diagram image. The default image size is the size of the bitmap with 100% zoom. Parameters:

See common graph parameters

oSC

scorecardview (default): Returns a hierarchy view. The default image size is the size of the bitmap with 100% zoom. Parameters:

See common graph parameters

See common SC graph parameters

strategymapview: Returns a dashboards view. The default image size is the size of the bitmap with 100% zoom. Parameters:

See common graph parameters

See common SC graph parameters

graph: Returns the graph defined for the element. The default image size is the size of the bitmap with 100% zoom. Parameters:

See common graph parameters

See common SC graph parameters

See common SC chart parameters

rangecolor: Returns a circle filled with the range color of the defined element. Parameters:

See common graph parameters

See common SC graph parameters

trend: Returns the trend arrow. The default image size is 16x16 with the default trend arrow. Parameters:

See common graph parameters

See common SC graph parameters

 

Common graph parameters:

ozoom = <zoom value>: Zoom level. This needs to be a positive integer with an optional "%" suffix.

owidth = <image width in pixels>: This parameter overrides the default image width value.

oheight = <image height in pixels>: This parameter overrides the default image height value.

otype = <image type>: Type of the image in the returned binary content. Supported formats: bmp, png, and jpg. Also wmf is supported for QPR Metrics graphs.

oviewsettings = <name or FullID>: Name or full ID of view or graph template depending on the graph type. This option is supported with all graph types except for trend and rangecolor. In case this parameter is omitted or the value refers to invalid or non-existent view/template, the default one is used.

 

Common PG graph parameters:

ocliprect = <left>,<top>,<right>,<bottom>: This parameter is used to retrieve an image of the desired section of the actual image. The coordinates are in the physical pixel coordinates of the actual full image.

odraworganizations = This parameter is used to force the organization units to be drawn into the image clipped with the cliprect parameter. Possible values are 0 (no, default value) and 1 (yes).

 

Common SC graph parameters:

operiod = <ID, full ID, or name of a period>. Select the period that is used. Also the following special values are available:

o-1 = latest

o-2 = current

o-3 = latest for all

o-4 = chart period (uses settings defined in QPR Metrics client)

o-5 = previous

o-6 = nexts

oseries = <ID, full ID, or symbol of a series>. Select the series that is used. Also the following special values are available:

-1 = default series

 

Language parameters similarly as in the QueryObjects function.

 

 

Example Procedure:

 

NOTE: The example below requires Integrated Windows Authentication to be used. Otherwise authentication needs to be done e.g. via JavaScript.

 

<html>

<head>

<title>SC Graph</title>

</head>

<body>

<p>Graph from QPR Web Services Foundation</p>

<img src="http://localhost/QPR2014-1/Portal/QPR.ISAPI.dll/wsforward/MainService.svc/webHttp/GetGraphAsStream?objectId=%22SC.1938773693.5521%22" />

</body>

</html>