GetChartMgr

Description

Returns the CHARTMGR object associated with the current session.

You can use the CHARTMGR object to generate charts and control the appearance of the output files.

Note: This method is for Windows™ only.

Syntax

VBScript


workspace.GetChartMgr 

Perl


$workspace->GetChartMgr(); 
Identifier
Description
workspace
The Workspace object obtained from the current session.
Return value
The CHARTMGR object associated with the current session.

Examples

VBScript


Const OLEWKSPCSYSTEMQUERIES = 1

Dim oSession  ' a Session object

Dim cq_resultset ' a Resultset object

Dim cq_query_def ' a QueryDef object

Dim oWorkSpace ' a Workspace object

Dim oChartMgr ' a ChartMgr object

Dim querylist

Dim querystr

Dim filename

Set oSession = CreateObject("CLEARQUEST.SESSION")

oSession.UserLogon "admin", "", "RUC", AD_PRIVATE_SESSION, ""



Set oWorkSpace = oSession.GetWorkSpace

querylist = oWorkSpace.GetChartList(OLEWKSPCSYSTEMQUERIES)

For Each querystr In querylist

  Set cq_query_def = oWorkspace.GetChartDef(querystr)

  Set cq_resultset = oSession.BuildResultSet(cq_query_def)

  filename = "c:\test.jpg"

  Call cq_resultset.Execute

  Set oChartMgr = oWorkSpace.GetChartMgr

  Call oChartMgr.SetResultSet(cq_resultset)

  oChartMgr.Width = 600

  oChartMgr.Height = 600

  oChartMgr.MakeJPEG(filename)

  

Next 

Perl


use CQPerlExt;



$session = CQSession::Build();

$user = "admin";

$pass = "";

$db = "SAMPL";

$session->UserLogon($user, $pass, $db, "");



$wkSpc = $session->GetWorkSpace();

$chartDef = $wkSpc->GetChartDef("Personal Queries/Sample_Chart");

$resultSet = $session->BuildResultSet($chartDef);

$resultSet->Execute();



$chartMgr = $wkSpc->GetChartMgr();

$chartMgr->SetResultSet($resultSet);

$chartMgr->MakeJPEG("C:\\temp\\BBChart.jpg");



CQSession::Unbuild($session);