Student Assignment History — Counsel


This custom report can be used with the Meeting Editor and displays the history for each student in the Publisher Database. It is very easy to see which counsel points the student has not worked on yet.

I welcome your feedback about this custom report!


Sample Student Info


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns="" xmlns:msa="">
	<xsl:output method="html" indent="yes" version="4.01"
	  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
	<xsl:param name="CSSFile1"></xsl:param>

	<xsl:variable name="HistDB" select="document('AssignHistory.XML')"/>
	<xsl:variable name="PubDB" select="document('MSA_PublisherDatabase.XML')"/>

	<xsl:template match="/">
				<meta http-equiv="X-UA-Compatible" content="IE=edge" />
				<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
				<title>Student Assignments History</title>
			<!-- CSS Stylesheet -->
				* { font-family: Tahoma; }
				div.container {
					margin: 2mm; 
					padding: 2mm; 
					width: 100mm; 
					border: solid 1px black;
					position: relative;
				table.counsel {
					border: solid 1px black; 
					border-collapse: collapse; 
				th.counsel {
					border: solid 1px black; 
					padding: 2mm; 
					text-align: center; 
					background-color: darkgrey; 
				td.counsel { 
					border: solid 1px black; 
					padding: 2mm; 
					text-align: center; 
				tr:nth-child(even) { 
					background-color: lightgrey; 
				p.not-assigned { 
					border-top: solid 1px black; 
				@media print { 
					.container { 
						display: block; 
					div { 
						page-break-inside: avoid; 
				<h1>Student Assignment History — Counsel</h1>
				<xsl:for-each select="$PubDB/msa:PublisherDatabase/msa:Publishers/msa:Publisher/msa:Name">
					<!-- Keep each students information in it's own container. This prevents splitting over page breaks when printing.-->
					<div class="container">
							<xsl:value-of select="."/>
						<xsl:variable name="strName" select="."/>
							<!-- Only display a table if the student has history data -->
							<xsl:when test="count($HistDB//AssignmentHistory/*/StudentItems/Item/Name[@Counsel and .=$strName]) != 0">
								<table class="counsel">
										<col width="50%"/>
										<col width="50%"/>
									<!-- Column Headings-->
										<th class="counsel">Counsel</th>
										<th class="counsel">Week</th>

									<!-- Test for the Counsel attribute so that we exclude Assistant items -->
									<!-- Limit counsel data to the student -->
									<xsl:for-each select="$HistDB//AssignmentHistory/*/StudentItems/Item/Name[@Counsel and .=$strName]">
										<!-- Sort by counsel number (ascending) -->
										<xsl:sort select="@Counsel" data-type="number"/>

										<!-- Then sort by date (ascending) -->
										<xsl:sort select="local-name(../../..)"/>

											<!-- Counsel -->
											<td class="counsel">
												<xsl:value-of select="@Counsel"/>
											<!-- Date DD/MM/YYYY -->
											<td class="counsel">
												<xsl:variable name="strWeek" select="local-name(../../..)"/>
												<xsl:value-of select="substring($strWeek, 8, 2)"/>
												<xsl:value-of select="substring($strWeek, 5, 2)"/>
												<xsl:value-of select="substring($strWeek, 2, 4)"/>

								<!-- Indicate which lessons the students has not been assigned -->
								<xsl:variable name="missing-items">
									<xsl:call-template name="list-missing-items">
										<xsl:with-param name="items" select ="$HistDB//AssignmentHistory/*/StudentItems/Item/Name[@Counsel and .=$strName]"/>
								<p class="not-assigned">
									<xsl:text>Not assigned: </xsl:text>
									<xsl:value-of select="translate(normalize-space($missing-items), ' ', ',')" />
									<xsl:text>No student history found.</xsl:text>

	<xsl:template name="list-missing-items">
		<xsl:param name="items"/>
		<xsl:param name="max" select="20"/>
		<xsl:if test="$max > 1">
			<xsl:call-template name="list-missing-items">
				<xsl:with-param name="items" select="$items"/>
				<xsl:with-param name="max" select="$max - 1"/>
		<xsl:if test="not ($max=$items/@Counsel)">
			<xsl:value-of select="$max" />
			<xsl:text> </xsl:text>



Some of the headings are in English and you will need to modify the script as required.

See these line numbers (highlighted):

  • 62
  • 83
  • 84
  • 122
  • 129


Please download the ZIP archive and install from within the Meeting Editor. Make sure you have selected the Custom tab.

Student Assignment History — Counsel
Student Assignment History — Counsel
Size: 2 KB
Version: 1.0
Published: 14/07/2023


Please consider providing feedback about this custom template:

0.0 out of 5 stars (based on 0 reviews)
Very good0%

There are no reviews yet. Be the first one to write one.