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 ?
ORDER BY ?

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
          ...
          END

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:

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

<server>
Set tMsg = $Get(%request.Data("Error:ErrorCode",1))
    If ((tMsg'="")&&($SYSTEM.Status.GetErrorCodes(tMsg)'[$$$ERRORCODE($$$RequireAuthentication))) {
        &html<<center>>
        write "Auth failed!"
        &html<</center>>
    }
</server>
</body>
</html>

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")

to

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 = "http://www.intersystems.com/zen/report/definition" ]
{
<report xmlns="http://www.intersystems.com/zen/report/definition"
   name="test" sql="select 1 q">
   <group name="q" breakOnField="q"/>
  </report>
}

/// 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 = "http://www.intersystems.com/zen/report/display" ]
{
<report xmlns="http://www.intersystems.com/zen/report/display"
    name="test">
    <document width="8.5in"
            height="11in"
            marginLeft="1.25in"
            marginRight="1.25in"
            marginTop="1.0in"
            marginBottom="1.0in" />
    <body>
        <clineChart
                ongetData="getChartData"
                title="Availability"
                height="400px"
                width="400px"
                currYAxis="0"
                labelsVisible="true"
                lineStyle="red"
                markersVisible="true"
                plotStyle="stroke-width: 1px;"
                seriesCount="2"
                seriesNames="Name1,Name2"
                seriesYAxes="0"
                ongetLabelX="getAxisTime"
                >
            <yAxis minValue="0"
                    maxValue="100" />
        </clineChart>
    </body>
</report>
}

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

Method getAxisTime(
    val,
    yseries)
{
 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]

[1] https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page...
[2] https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page...

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 (https://stackoverflow.com/a/1732454/82675). Limited subset of HTML -- maybe.