...
Code that can be entered into a Report Template:
<%
// Create table and heading row using HTML
Output.Write("<table border='1' cellspacing='0' cellpadding='5'>");
Output.Write("<tr><th>Encounter Date</th> <th>Encounter Name</th></tr>");
// Loop through the encounters and output the encounter date and encounter name
// Each time through will create a row in the table with the next encounter
for (var index=0; index < ENCOUNTERS.Count; index++) {
var encounter = ENCOUNTERS.GetEncounter(index);
var encounterDate = encounter.#EncounterDate;
var encounterName = encounter.#IntervalName;
...