<pdf>

	<version>1.0.0</version>
	<title>PDF Template Demo - Service report</title>
	<date>2026-10-05</date>
	<note>Service report / work order demo: master / detail sections bound to array data (DataProviderArray), checkboxes with printif</note>

	<default_page>
		<orientation>P</orientation>
		<unit>mm</unit>
		<format>A4</format>
	</default_page>

	<doc_info>
		<creator>Alien Project</creator>
		<author>#MBR</author>
		<title>PDF Service Report Demo</title>
		<subject>Copyright (C) 2026 - Alien Project</subject>
		<keywords>service report, work order, field service, maintenance, pdf, example</keywords>
	</doc_info>

	<section id="wo" y_start="0" rows_count="1">
		<!-- One page for each intervention (data row of the "wo" section) -->
		<page format="A4" orientation="P"/>

		<!-- For debug, set BORDER=1 to check the box sizes -->
		<setvar name="BORDER" value="0"/>
		<setvar name="COLOR_DARK" value="1d4a2a"/>
		<setvar name="COLOR_ACCENT" value="339933"/>
		<setvar name="COLOR_LIGHT" value="a9dba9"/>
		<setvar name="COLOR_SOFT" value="eef6ee"/>
		<setvar name="COLOR_LINE" value="d3e6d3"/>
		<setvar name="COLOR_TRAVEL" value="3f7c99"/>
		<setvar name="COLOR_MATERIAL" value="c98a12"/>
		<setvar name="COLOR_TEXT" value="222222"/>
		<setvar name="COLOR_GREY" value="6c757d"/>
		<setvar name="COLOR_WHITE" value="ffffff"/>
		<!-- Number format: 1,234.50 -->
		<setvar name="NUMERICDECIMALSEPARATOR" value="."/>
		<setvar name="NUMERICTHOUSANDSEPARATOR" value=","/>

		<print_content>wo_header</print_content>
		<print_content>wo_lines_header</print_content>

		<section id="wo_det" row_height="6.5" rows_count="9">
			<!-- Labour, travel and materials in one table: the "type" field (L, T, M) selects the colored label -->
			<print_content>wo_lines_row</print_content>
		</section>

		<print_content>wo_footer</print_content>
	</section>

	<section id="finalize">
		<output>
			<dest>I</dest>
			<name>service-report.pdf</name>
			<isUTF8>true</isUTF8>
		</output>
	</section>

	<!-- ********************************** -->

	<content id="wo_header">
		<!-- Top band with the service company -->
		<box x="0" y="0" width="210" height="32" border="0" text="">
			<fill type="S" color="{COLOR_DARK}"/>
		</box>
		<fill type="N"/>
		<rectangle x1="0" y1="32" x2="210" y2="33.5" radius="0" border="0000">
			<linestyle width="0"/>
			<fill type="S" color="{COLOR_ACCENT}"/>
		</rectangle>

		<!-- Logo drawn with shapes: a snowflake in a circle -->
		<circle x="22" y="16" r="7.5">
			<linestyle width="0"/>
			<fill type="S" color="{COLOR_ACCENT}"/>
		</circle>
		<fill type="N"/>
		<line x="22" y="11" width="1" height="10">
			<orientation>VerticallyLeft</orientation>
			<linestyle width="0.7" color="{COLOR_WHITE}"/>
		</line>
		<line x="17.7" y="13.5" width="8.6" height="5">
			<orientation>DiagonallyForward</orientation>
			<linestyle width="0.7" color="{COLOR_WHITE}"/>
		</line>
		<line x="17.7" y="13.5" width="8.6" height="5">
			<orientation>DiagonallyBackward</orientation>
			<linestyle width="0.7" color="{COLOR_WHITE}"/>
		</line>

		<box x="33" y="7" width="90" height="8" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>{COMPANY_NAME}</text>
			<font family="Helvetica" style="B" size="14" color="{COLOR_WHITE}"/>
		</box>
		<box x="33" y="15.5" width="90" height="13" border="{BORDER}" horizalign="Left" vertalign="Top">
			<text>{COMPANY_ADDRESS} - {COMPANY_CITY}
Phone {COMPANY_PHONE} - {COMPANY_EMAIL}
{COMPANY_WEBSITE} - {COMPANY_VAT}</text>
			<font family="Helvetica" style="N" size="8" color="c4d9c8"/>
		</box>
		<box x="120" y="6" width="75" height="10" border="{BORDER}" horizalign="Right" vertalign="Center">
			<text>SERVICE REPORT</text>
			<font family="Helvetica" style="B" size="20" color="{COLOR_WHITE}"/>
		</box>
		<box x="120" y="17" width="75" height="6" border="{BORDER}" horizalign="Right" vertalign="Center">
			<text>No. {wo.number}</text>
			<font family="Helvetica" style="B" size="11" color="{COLOR_LIGHT}"/>
		</box>
		<box x="120" y="23" width="75" height="5" border="{BORDER}" horizalign="Right" vertalign="Center">
			<text>Ticket {wo.ticket} - {wo.date}</text>
			<font family="Helvetica" style="N" size="9" color="c4d9c8"/>
		</box>

		<!-- Customer and site -->
		<box x="15" y="39" width="85" height="5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>CUSTOMER</text>
			<font family="Helvetica" style="B" size="8" color="{COLOR_ACCENT}"/>
		</box>
		<line x="15" y="44.5" width="85" height="1">
			<orientation>HorizontallyTop</orientation>
			<linestyle width="0.3" color="{COLOR_LINE}"/>
		</line>
		<box x="15" y="45" width="85" height="6" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>{wo.customerName}</text>
			<font family="Helvetica" style="B" size="10" color="{COLOR_TEXT}"/>
		</box>
		<box x="15" y="51" width="85" height="13" border="{BORDER}" horizalign="Left" vertalign="Top">
			<text>{wo.customerAddress}, {wo.customerCity}
Contact: {wo.customerContact}
Requested by {wo.requestedBy} on {wo.requestedOn}</text>
			<font family="Helvetica" style="N" size="8.5" color="{COLOR_TEXT}"/>
		</box>

		<box x="110" y="39" width="85" height="5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>SITE</text>
			<font family="Helvetica" style="B" size="8" color="{COLOR_ACCENT}"/>
		</box>
		<line x="110" y="44.5" width="85" height="1">
			<orientation>HorizontallyTop</orientation>
			<linestyle width="0.3" color="{COLOR_LINE}"/>
		</line>
		<box x="110" y="45" width="85" height="6" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>{wo.siteName}</text>
			<font family="Helvetica" style="B" size="10" color="{COLOR_TEXT}"/>
		</box>
		<box x="110" y="51" width="85" height="13" border="{BORDER}" horizalign="Left" vertalign="Top">
			<text>{wo.siteAddress}
{wo.siteCity}
{wo.siteAccess}</text>
			<font family="Helvetica" style="N" size="8.5" color="{COLOR_TEXT}"/>
		</box>

		<!-- Equipment and intervention data -->
		<rectangle x1="15" y1="67" x2="195" y2="85" radius="1.5" border="1111">
			<linestyle width="0"/>
			<fill type="S" color="{COLOR_SOFT}"/>
		</rectangle>
		<fill type="N"/>
		<line x="15" y="76" width="180" height="1">
			<orientation>HorizontallyTop</orientation>
			<linestyle width="0.3" color="{COLOR_WHITE}"/>
		</line>
		<line x="70" y="67" width="1" height="18">
			<orientation>VerticallyLeft</orientation>
			<linestyle width="0.3" color="{COLOR_WHITE}"/>
		</line>
		<line x="117" y="67" width="1" height="18">
			<orientation>VerticallyLeft</orientation>
			<linestyle width="0.3" color="{COLOR_WHITE}"/>
		</line>
		<line x="156" y="67" width="1" height="18">
			<orientation>VerticallyLeft</orientation>
			<linestyle width="0.3" color="{COLOR_WHITE}"/>
		</line>
		<font family="Helvetica" style="N" size="6.5" color="{COLOR_GREY}"/>
		<box x="18" y="67.8" width="50" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>EQUIPMENT</text></box>
		<box x="73" y="67.8" width="42" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>MODEL</text></box>
		<box x="120" y="67.8" width="34" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>SERIAL NUMBER</text></box>
		<box x="159" y="67.8" width="34" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>LOCATION</text></box>
		<box x="18" y="76.8" width="50" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>INTERVENTION TYPE</text></box>
		<box x="73" y="76.8" width="42" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>SERVICE CONTRACT</text></box>
		<box x="120" y="76.8" width="34" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>TECHNICIAN</text></box>
		<box x="159" y="76.8" width="34" height="3.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>INTERVENTION DATE</text></box>
		<font family="Helvetica" style="B" size="9" color="{COLOR_TEXT}"/>
		<box x="18" y="71.3" width="50" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo.equipment}</text></box>
		<box x="73" y="71.3" width="42" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo.model}</text></box>
		<box x="120" y="71.3" width="34" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo.serial}</text></box>
		<box x="159" y="71.3" width="34" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo.location}</text></box>
		<box x="18" y="80.3" width="50" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo.interventionType}</text></box>
		<box x="73" y="80.3" width="42" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo.contract}</text></box>
		<box x="120" y="80.3" width="34" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo.technician}</text></box>
		<box x="159" y="80.3" width="34" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo.date}</text></box>

		<!-- Request (from the customer) -->
		<box x="15" y="89" width="180" height="5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>REQUEST</text>
			<font family="Helvetica" style="B" size="8" color="{COLOR_ACCENT}"/>
		</box>
		<rectangle x1="15" y1="95" x2="15.8" y2="104" radius="0" border="0000">
			<linestyle width="0"/>
			<fill type="S" color="{COLOR_LIGHT}"/>
		</rectangle>
		<fill type="N"/>
		<box x="18" y="95" width="177" height="9" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>{wo.request}</text>
			<font family="Helvetica" style="I" size="8.5" color="{COLOR_TEXT}"/>
		</box>

		<!-- Work performed (multi-line text) -->
		<box x="15" y="108" width="180" height="5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>WORK PERFORMED</text>
			<font family="Helvetica" style="B" size="8" color="{COLOR_ACCENT}"/>
		</box>
		<box x="15" y="114" width="180" height="30" border="{BORDER}" horizalign="Left" vertalign="Top">
			<text>{wo.work}</text>
			<font family="Helvetica" style="N" size="9" color="{COLOR_TEXT}"/>
		</box>
	</content>

	<!-- ********************************** -->

	<content id="wo_lines_header">
		<box x="15" y="146" width="180" height="5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>LABOUR, TRAVEL AND MATERIALS</text>
			<font family="Helvetica" style="B" size="8" color="{COLOR_ACCENT}"/>
		</box>
		<font family="Helvetica" style="B" size="7" color="{COLOR_GREY}"/>
		<fill type="N"/>
		<box x="15" y="151" width="20" height="6" border="{BORDER}" horizalign="Left" vertalign="Center"><text>TYPE</text></box>
		<box x="38" y="151" width="76" height="6" border="{BORDER}" horizalign="Left" vertalign="Center"><text>TECHNICIAN / MATERIAL</text></box>
		<box x="114" y="151" width="20" height="6" border="{BORDER}" horizalign="Left" vertalign="Center"><text>DATE</text></box>
		<box x="134" y="151" width="26" height="6" border="{BORDER}" horizalign="Left" vertalign="Center"><text>FROM - TO</text></box>
		<box x="160" y="151" width="20" height="6" border="{BORDER}" horizalign="Right" vertalign="Center"><text>QTY</text></box>
		<box x="182" y="151" width="13" height="6" border="{BORDER}" horizalign="Left" vertalign="Center"><text>UNIT</text></box>
		<line x="15" y="157" width="180" height="1">
			<orientation>HorizontallyTop</orientation>
			<linestyle width="0.4" color="{COLOR_DARK}"/>
		</line>
	</content>

	<!-- ********************************** -->

	<content id="wo_lines_row">
		<!-- Colored label: one rectangle for each type, only the matching one is printed -->
		<rectangle x1="15" y1="158.6" x2="33" y2="162.9" radius="1" border="1111" printif="{wo_det.type}=L">
			<linestyle width="0"/>
			<fill type="S" color="{COLOR_ACCENT}"/>
		</rectangle>
		<rectangle x1="15" y1="158.6" x2="33" y2="162.9" radius="1" border="1111" printif="{wo_det.type}=T">
			<linestyle width="0"/>
			<fill type="S" color="{COLOR_TRAVEL}"/>
		</rectangle>
		<rectangle x1="15" y1="158.6" x2="33" y2="162.9" radius="1" border="1111" printif="{wo_det.type}=M">
			<linestyle width="0"/>
			<fill type="S" color="{COLOR_MATERIAL}"/>
		</rectangle>
		<fill type="N"/>
		<box x="15" y="158.6" width="18" height="4.3" border="{BORDER}" horizalign="Center" vertalign="Center">
			<text>{wo_det.typeLabel}</text>
			<font family="Helvetica" style="B" size="6" color="{COLOR_WHITE}"/>
		</box>
		<font family="Helvetica" style="N" size="8.5" color="{COLOR_TEXT}"/>
		<box x="38" y="157.5" width="76" height="6.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo_det.description}</text></box>
		<font family="Helvetica" style="N" size="8.5" color="{COLOR_GREY}"/>
		<box x="114" y="157.5" width="20" height="6.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo_det.date}</text></box>
		<box x="134" y="157.5" width="26" height="6.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo_det.fromTo}</text></box>
		<font family="Helvetica" style="B" size="9" color="{COLOR_TEXT}"/>
		<!-- Hours with 2 decimals, material quantities as integers -->
		<box x="160" y="157.5" width="20" height="6.5" border="{BORDER}" horizalign="Right" vertalign="Center" format="F2" printif="{wo_det.type}!=M"><text>{wo_det.qty}</text></box>
		<box x="160" y="157.5" width="20" height="6.5" border="{BORDER}" horizalign="Right" vertalign="Center" format="I" printif="{wo_det.type}=M"><text>{wo_det.qty}</text></box>
		<box x="182" y="157.5" width="13" height="6.5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>{wo_det.unit}</text>
			<font family="Helvetica" style="N" size="8" color="{COLOR_GREY}"/>
		</box>
		<line x="15" y="164" width="180" height="1">
			<orientation>HorizontallyTop</orientation>
			<linestyle width="0.2" color="{COLOR_LINE}"/>
		</line>
	</content>

	<!-- ********************************** -->

	<content id="wo_footer">
		<fill type="N"/>

		<!-- Checkboxes: the check mark is printed only when the field is "yes" -->
		<font family="Helvetica" style="N" size="9" color="{COLOR_TEXT}"/>
		<rectangle x1="15" y1="220" x2="19.5" y2="224.5" radius="0.8" border="1111">
			<linestyle width="0.3" color="{COLOR_DARK}"/>
			<fill type="N"/>
		</rectangle>
		<rectangle x1="15" y1="227" x2="19.5" y2="231.5" radius="0.8" border="1111">
			<linestyle width="0.3" color="{COLOR_DARK}"/>
			<fill type="N"/>
		</rectangle>
		<rectangle x1="15" y1="234" x2="19.5" y2="238.5" radius="0.8" border="1111">
			<linestyle width="0.3" color="{COLOR_DARK}"/>
			<fill type="N"/>
		</rectangle>
		<rectangle x1="15" y1="220" x2="19.5" y2="224.5" radius="0.8" border="1111" printif="{wo.warranty}=yes">
			<linestyle width="0.3" color="{COLOR_ACCENT}"/>
			<fill type="S" color="{COLOR_ACCENT}"/>
		</rectangle>
		<rectangle x1="15" y1="227" x2="19.5" y2="231.5" radius="0.8" border="1111" printif="{wo.completed}=yes">
			<linestyle width="0.3" color="{COLOR_ACCENT}"/>
			<fill type="S" color="{COLOR_ACCENT}"/>
		</rectangle>
		<rectangle x1="15" y1="234" x2="19.5" y2="238.5" radius="0.8" border="1111" printif="{wo.followUp}=yes">
			<linestyle width="0.3" color="{COLOR_ACCENT}"/>
			<fill type="S" color="{COLOR_ACCENT}"/>
		</rectangle>
		<fill type="N"/>
		<!-- Check mark: character "4" of the ZapfDingbats font -->
		<font family="ZapfDingbats" style="N" size="8" color="{COLOR_WHITE}"/>
		<box x="13.75" y="220" width="7" height="4.5" border="0" horizalign="Center" vertalign="Center" textfit="None" printif="{wo.warranty}=yes"><text>4</text></box>
		<box x="13.75" y="227" width="7" height="4.5" border="0" horizalign="Center" vertalign="Center" textfit="None" printif="{wo.completed}=yes"><text>4</text></box>
		<box x="13.75" y="234" width="7" height="4.5" border="0" horizalign="Center" vertalign="Center" textfit="None" printif="{wo.followUp}=yes"><text>4</text></box>
		<font family="Helvetica" style="N" size="9" color="{COLOR_TEXT}"/>
		<box x="22" y="220" width="80" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>Under warranty</text></box>
		<box x="22" y="227" width="80" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>Intervention completed</text></box>
		<box x="22" y="234" width="80" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>Further intervention needed</text></box>
		<box x="22" y="239" width="106" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center" printif="{wo.followUp}=yes">
			<text>{wo.followUpNote}</text>
			<font family="Helvetica" style="I" size="7.5" color="{COLOR_GREY}"/>
		</box>

		<!-- Totals -->
		<rectangle x1="132" y1="219" x2="195" y2="243" radius="1.5" border="1111">
			<linestyle width="0"/>
			<fill type="S" color="{COLOR_SOFT}"/>
		</rectangle>
		<fill type="N"/>
		<font family="Helvetica" style="N" size="8.5" color="{COLOR_GREY}"/>
		<box x="135" y="220" width="35" height="5.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>Labour</text></box>
		<box x="135" y="225.5" width="35" height="5.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>Travel</text></box>
		<box x="135" y="231" width="35" height="5.5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>Materials used</text></box>
		<font family="Helvetica" style="B" size="9" color="{COLOR_TEXT}"/>
		<box x="160" y="220" width="32" height="5.5" border="{BORDER}" horizalign="Right" vertalign="Center" format="C2 h"><text>{wo.labourHours}</text></box>
		<box x="160" y="225.5" width="32" height="5.5" border="{BORDER}" horizalign="Right" vertalign="Center" format="C2 h"><text>{wo.travelHours}</text></box>
		<box x="160" y="231" width="32" height="5.5" border="{BORDER}" horizalign="Right" vertalign="Center"><text>{wo.materialsCount} items</text></box>
		<box x="135" y="237" width="57" height="5" border="{BORDER}" horizalign="Right" vertalign="Center">
			<text>{wo.billing}</text>
			<font family="Helvetica" style="I" size="6.5" color="{COLOR_GREY}"/>
		</box>

		<!-- Signatures -->
		<rectangle x1="15" y1="248" x2="100" y2="278" radius="1.5" border="1111">
			<linestyle width="0.3" color="{COLOR_LINE}"/>
			<fill type="N"/>
		</rectangle>
		<rectangle x1="110" y1="248" x2="195" y2="278" radius="1.5" border="1111">
			<linestyle width="0.3" color="{COLOR_LINE}"/>
			<fill type="N"/>
		</rectangle>
		<font family="Helvetica" style="B" size="7.5" color="{COLOR_DARK}"/>
		<box x="18" y="249" width="80" height="5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>Technician</text></box>
		<box x="113" y="249" width="80" height="5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>Customer</text></box>
		<!-- Technician signature: the name in italics (a signature image can be used, eg. <image><file>./images/signature.png</file></image>) -->
		<box x="25" y="256" width="66" height="10" border="0" horizalign="Center" vertalign="Center">
			<text>{wo.technician}</text>
			<font family="Times" style="I" size="17" color="1f3a5f"/>
		</box>
		<font family="Helvetica" style="N" size="7.5" color="{COLOR_GREY}"/>
		<box x="18" y="271.5" width="80" height="5" border="{BORDER}" horizalign="Left" vertalign="Center"><text>{wo.technician} - {COMPANY_NAME}</text></box>
		<line x="113" y="266.5" width="79" height="1">
			<orientation>HorizontallyTop</orientation>
			<linestyle width="0.2" color="{COLOR_LINE}"/>
		</line>
		<box x="113" y="267" width="80" height="4.5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>{wo.signedBy}</text>
			<font family="Helvetica" style="B" size="8" color="{COLOR_TEXT}"/>
		</box>
		<box x="113" y="271.5" width="80" height="5" border="{BORDER}" horizalign="Left" vertalign="Center">
			<text>Signed on {wo.signedAt}</text>
			<font family="Helvetica" style="N" size="7.5" color="{COLOR_GREY}"/>
		</box>

		<box x="15" y="283" width="180" height="5" border="{BORDER}" horizalign="Center" vertalign="Center">
			<text>Service report {wo.number} - {COMPANY_NAME} - {COMPANY_WEBSITE} - The customer confirms the work performed and the hours above</text>
			<font family="Helvetica" style="I" size="7" color="{COLOR_GREY}"/>
		</box>
	</content>

</pdf>
