12.07.2015 Views

Using Zen Reports - InterSystems Documentation

Using Zen Reports - InterSystems Documentation

Using Zen Reports - InterSystems Documentation

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AttributesqlDescription(Optional) Server-side SQL query to get contents of the or list.This attribute has the underlying data type %ZEN.Datatype.sql. Thismeans it cannot be accessed from the client. Its value is encrypted(using the current session key) when it is sent to the client. If thisvalue is returned to the server, it is automatically decrypted. Thismakes it possible to place sensitive data on the client for futureprocessing on the server, without letting a user view this data.If you use the OnCreateResultSet attribute to specify a server-side callback method, as in this example:Then the method named by the OnCreateResultSet attribute must be defined within the page class withthe specific signature shown in the following example:ClassMethod CreateRS(ByRef pSC As %Status, ByRef pParameters) As %ResultSet{set rs = ##class(%ResultSet.SQL).%New()set sql = "SELECT Name FROM Sample.Person where Home_State=?"set pSC = rs.Prepare(sql)set pSC = rs.Execute(pParameters(1))quit rs}Where:• The callback method must instantiate and return a new instance of a %ResultSet object. Thisresultset then becomes the source of data for the or .• The callback method must return a status code by reference to indicate whether or not there wereany errors encountered in creating the %ResultSet object.• The required inbound argument pParameters is an array that, at runtime, automatically containsany values that you supplied in the or definition, such as the value"AL" for Home_State in the example above.The pParameters array is subscripted by a 1–based number that indicates the order of theseparameters in the or definition. Even if there are no elements, ifyou omit the inbound argument pParameters from the callback method signature, the resultingreport will be empty.<strong>Using</strong> <strong>Zen</strong> <strong>Reports</strong> 31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!