Not possible to do this in Query. You need to use dynamic SQL.

Symbol ":" is used to indicate host variables. Host variables are treated as expressions, not as identifiers.

During query compilation host variables are replaced with placeholders.

Consider query:

SELECT FirstName, MiddleName, LastName, Email, UserType 
FROM DB.ExternalUsers
WHERE FirstName like :objSearch.FirstName
ORDER BY :objSearch.SortingField

This query is compiled as:

SELECT FirstName, MiddleName, LastName, Email, UserType 
FROM DB.ExternalUsers
WHERE FirstName like ?

Then during runtime you supply values as follows:
objSearch.FirstName = 'A%'
objSearch.SortingField = 'FirstName'

And query is executed as follows:

SELECT FirstName, MiddleName, LastName, Email, UserType 
FROM DB.ExternalUsers
WHERE FirstName like 'A%'
ORDER BY 'FirstName'

Notice 'FirstName' is in quotes in ORDER BY. So you sort by literal string. That is doing nothing.

What you can do is to use expression like:

 Order by CASE :objSearch.SortingField
          WHEN 'FirstName' THEN FirstName
          WHEN 'MiddleName' THEN MiddleName

Although such generic queries makes SQL Query Analyzer unable to reason what plan is better to use for this query.

Name the file login.csp

And inside it check for Error:ErrorCode request parameter:

My login page:</br>
<form method='post'>
Name: <input name="CacheUserName"/><br/>
Password: <input type='password' name="CachePassword"/><br/>
<input type='submit'/>

Set tMsg = $Get(%request.Data("Error:ErrorCode",1))
    If ((tMsg'="")&&($SYSTEM.Status.GetErrorCodes(tMsg)'[$$$ERRORCODE($$$RequireAuthentication))) {
        write "Auth failed!"

Hi Oliver.

It's hard to say what's wrong with your report, as example that you provided is not standalone -- it requires table AETMON.AvailabilityLog.

At least I think, you should change

Set var(tCount,0) = rs.%Get("availabilityStatus")
Set var(tCount,1) = rs.%Get("CreatedTime")


Set var(0, tCount) = rs.%Get("availabilityStatus")
Set var(1, tCount) = rs.%Get("CreatedTime")

You have seriesCount="1". That is amount of lines to show on chart.
Then you have seriesNames="Name1,Name2". These are names of lines. So either here you should have one name, or seriesCount should be 2.

You have seriesSize="2". This is amount of points to draw from each serie. If you indeed need only 2 points, then that's OK. However, if you remove this attribute then all points are plotted.

Generally, please see class reference for %ZEN.Report.Display.COSChart.cchart. It explains many attributes.

Below please find small sample that works. Ignore ReportDefinition. It's just there to make report run.

I hope it'll give you some hints.

Class community.ClineReport Extends %ZEN.Report.reportPage

Parameter DEFAULTMODE As STRING = "html";

/// This XML defines the logical contents of this report.
XData ReportDefinition [ XMLNamespace = "" ]
<report xmlns=""
   name="test" sql="select 1 q">
   <group name="q" breakOnField="q"/>

/// This XML defines the display for this report.
/// This is used to generate the XSLT stylesheets for both HTML and XSL-FO.
XData ReportDisplay [ XMLNamespace = "" ]
<report xmlns=""
    <document width="8.5in"
            marginBottom="1.0in" />
                plotStyle="stroke-width: 1px;"
            <yAxis minValue="0"
                    maxValue="100" />

Method getChartData(
    ByRef data,
    for i=1:1:10 {
        set data(0,i-1)=i * 2
        set data(1,i-1)=i * 3

Method getAxisTime(
 quit $zdt($H-100 + val)


Indeed, documentation [1] says that this is "Number of private global data blocks used by this process.". So this is due to process-private globals

You can inspect these global using ^GETPPGINFO utility [2]


You should use Locate:

Set tRegEx = "<[^>]*>"
Set htmlSnippet = "<h1>Hello1</h1><h1>Hello2</h1>"
Set regex=##class(%Regex.Matcher).%New(tRegEx)
set regex.Text = htmlSnippet
while regex.Locate() {
    write "Found ",regex.Group," at position ",regex.Start,!

Also it's not possible to parse generic HTML with regular expressions ( Limited subset of HTML -- maybe.