<?xml version="1.0" encoding="UTF-8"?>
<structure version="14" html-doctype="HTML4 Transitional" compatibility-view="IE9" relativeto="*SPS" encodinghtml="UTF-8" encodingrtf="ISO-8859-1" encodingpdf="UTF-8" useimportschema="1" embed-images="1" pastemode="xml" enable-authentic-scripts="1" authentic-scripts-in-debug-mode-external="0" generated-file-location="DEFAULT">
	<parameters/>
	<schemasources>
		<namespaces/>
		<schemasources>
			<xsdschemasource name="XML" main="1" schemafile="Directory.xsd" workingxmlfile="Directory.xml"/>
		</schemasources>
	</schemasources>
	<modules/>
	<flags>
		<scripts/>
		<globalparts/>
		<designfragments/>
		<pagelayouts/>
		<xpath-functions/>
	</flags>
	<scripts>
		<script language="javascript"/>
	</scripts>
	<script-project>
		<Project version="2" app="AuthenticView"/>
	</script-project>
	<importedxslt/>
	<globalstyles>
		<rule url="Samples.css">
			<media>
				<media value="all"/>
			</media>
		</rule>
	</globalstyles>
	<mainparts>
		<children>
			<globaltemplate subtype="main" match="/">
				<document-properties/>
				<children>
					<documentsection>
						<properties columncount="1" columngap="0.50in" headerfooterheight="variable" pagemultiplepages="0" pagenumberingformat="1" pagenumberingstartat="auto" pagestart="next" paperheight="11.69in" papermarginbottom="0.79in" papermarginfooter="0.5in" papermarginheader="0.5in" papermarginleft="0.6in" papermarginright="0.6in" papermargintop="0.79in" paperwidth="8.27in"/>
					</documentsection>
					<template subtype="source" match="XML">
						<children>
							<paragraph paragraphtag="p">
								<properties class="info"/>
								<children>
									<text fixtext="This example shows how to print out tables on multiple pages with sub-totals."/>
								</children>
							</paragraph>
							<paragraph paragraphtag="p">
								<properties class="explanation"/>
								<children>
									<text fixtext="In this example you can see sub-totals before and after a table on every page, except that the first page does not have a leading sub-total and the last one reports a final Total"/>
								</children>
							</paragraph>
							<paragraph paragraphtag="p">
								<properties class="explanation"/>
								<children>
									<text fixtext="Because it would be technically impossible to make these tables auto-fit pages, you will need to define manually how many rows will fit on the first page and on every subsequent page. These two values are saved in variables, which are defined for $XML template and named RowsPerPage and RowsOnFirstPage. The rest is done by using XPath driven calculations based on these two values."/>
								</children>
							</paragraph>
							<paragraph paragraphtag="p"/>
							<template subtype="userdefined" match="1 to $CountOfPages">
								<children>
									<tgrid>
										<properties border="1"/>
										<children>
											<tgridbody-cols>
												<children>
													<tgridcol>
														<styles width="2.55in"/>
													</tgridcol>
													<tgridcol>
														<styles width="2.17in"/>
													</tgridcol>
													<tgridcol>
														<styles width="1.80in"/>
													</tgridcol>
												</children>
											</tgridbody-cols>
											<tgridheader-rows>
												<children>
													<tgridrow>
														<children>
															<tgridcell>
																<properties align="left"/>
																<children>
																	<text fixtext="Folder">
																		<styles font-weight="bold"/>
																	</text>
																</children>
															</tgridcell>
															<tgridcell>
																<properties align="left"/>
																<children>
																	<text fixtext="Filename">
																		<styles font-weight="bold"/>
																	</text>
																</children>
															</tgridcell>
															<tgridcell>
																<properties align="right"/>
																<children>
																	<text fixtext="Size">
																		<styles font-weight="bold"/>
																	</text>
																</children>
															</tgridcell>
														</children>
													</tgridrow>
													<template subtype="userdefined" match="if ( $CurrentPage &gt; 1 ) then 1 else ()">
														<children>
															<tgridrow>
																<children>
																	<tgridcell/>
																	<tgridcell/>
																	<tgridcell>
																		<properties align="right"/>
																		<children>
																			<text fixtext="Sub-Total: ">
																				<styles font-weight="bold"/>
																			</text>
																			<autocalc xpath="sum( $AllFiles[position() &lt; $RowFrom]/@size )">
																				<styles font-weight="normal"/>
																				<format basic-type="xsd" string="###,##0" datatype="integer"/>
																			</autocalc>
																		</children>
																	</tgridcell>
																</children>
															</tgridrow>
														</children>
														<variables/>
													</template>
												</children>
											</tgridheader-rows>
											<tgridbody-rows>
												<children>
													<template subtype="userdefined" match="$AllFiles[ position() &gt;= $RowFrom and position() &lt;= $RowTill ]">
														<children>
															<tgridrow>
																<children>
																	<tgridcell>
																		<children>
																			<autocalc xpath="string-join( ( ancestor::* )[ position() &gt; 1 ]/@name, &apos;\&apos; )"/>
																		</children>
																	</tgridcell>
																	<tgridcell>
																		<children>
																			<template subtype="attribute" match="name">
																				<children>
																					<content/>
																				</children>
																				<variables/>
																			</template>
																		</children>
																	</tgridcell>
																	<tgridcell>
																		<properties align="right"/>
																		<children>
																			<template subtype="attribute" match="size">
																				<children>
																					<content>
																						<format basic-type="xsd" string="###,##0" datatype="unsignedLong"/>
																					</content>
																				</children>
																				<variables/>
																			</template>
																		</children>
																	</tgridcell>
																</children>
															</tgridrow>
														</children>
														<variables/>
													</template>
												</children>
											</tgridbody-rows>
											<tgridfooter-rows>
												<children>
													<tgridrow>
														<children>
															<tgridcell>
																<properties align="right"/>
															</tgridcell>
															<tgridcell>
																<properties align="right"/>
															</tgridcell>
															<tgridcell>
																<properties align="right"/>
																<children>
																	<condition>
																		<children>
																			<conditionbranch xpath="$CurrentPage &lt; $CountOfPages">
																				<children>
																					<text fixtext="Sub-Total:">
																						<styles font-weight="bold"/>
																					</text>
																					<text fixtext=" "/>
																				</children>
																			</conditionbranch>
																			<conditionbranch>
																				<children>
																					<text fixtext="Total:">
																						<styles font-weight="bold"/>
																					</text>
																					<text fixtext=" "/>
																				</children>
																			</conditionbranch>
																		</children>
																	</condition>
																	<autocalc xpath="sum( $AllFiles[position() &lt;= $RowTill]/@size )">
																		<format basic-type="xsd" string="###,##0" datatype="integer"/>
																	</autocalc>
																</children>
															</tgridcell>
														</children>
													</tgridrow>
												</children>
											</tgridfooter-rows>
										</children>
									</tgrid>
									<condition>
										<children>
											<conditionbranch xpath="$CurrentPage &lt; $CountOfPages">
												<children>
													<newline break="page"/>
												</children>
											</conditionbranch>
										</children>
									</condition>
								</children>
								<variables>
									<variable name="CurrentPage" value="." valuetype="&lt;auto&gt;"/>
									<variable name="RowFrom" value="1 + (if ($CurrentPage &gt; 1) then $RowsOnFirstPage else 0) +
(if ($CurrentPage &gt; 2 ) then ($CurrentPage - 2) * $RowsPerPage else 0)" valuetype="&lt;auto&gt;"/>
									<variable name="RowTill" value="$RowFrom + (if ($CurrentPage = 1 ) then $RowsOnFirstPage else $RowsPerPage) - 1" valuetype="&lt;auto&gt;"/>
								</variables>
							</template>
						</children>
						<variables>
							<variable name="AllFiles" value="//file" valuetype="&lt;auto&gt;"/>
							<variable name="RowsPerPage" value="30" valuetype="&lt;auto&gt;"/>
							<variable name="RowsOnFirstPage" value="23" valuetype="&lt;auto&gt;"/>
							<variable name="CountOfPages" value="( count( //file ) idiv $RowsPerPage ) + 1" valuetype="&lt;auto&gt;"/>
						</variables>
					</template>
				</children>
			</globaltemplate>
		</children>
	</mainparts>
	<globalparts/>
	<designfragments/>
	<xmltables/>
	<authentic-custom-toolbar-buttons/>
</structure>
