<?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 subtotals. The subtotals also appear in headers and footers"/>
								</children>
							</paragraph>
							<paragraph paragraphtag="p">
								<properties class="explanation"/>
								<children>
									<text fixtext="In this example, you can see at the bottom of each page a running total of file sizes listed on that page. The running total is then carried over to the next page. It is placed not only inside the table (first and last rows), but also in the headers and footers of pages."/>
								</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 the $XML template and named RowsPerPage and RowsOnFirstPage. The rest is done by using XPath driven calculations based on these two values."/>
								</children>
							</paragraph>
							<template subtype="userdefined" match="1 to $CountOfPages">
								<children>
									<condition>
										<children>
											<conditionbranch xpath="$CurrentPage!=1">
												<children>
													<tgrid>
														<styles width="100%"/>
														<children>
															<tgridbody-cols>
																<children>
																	<tgridcol>
																		<properties width="3in"/>
																		<styles width="50%"/>
																	</tgridcol>
																	<tgridcol>
																		<properties width="50mm"/>
																		<styles width="50%"/>
																	</tgridcol>
																</children>
															</tgridbody-cols>
															<tgridbody-rows>
																<children>
																	<tgridrow>
																		<styles height="0.15in"/>
																		<children>
																			<tgridcell>
																				<styles font-size="10pt" padding="0"/>
																				<children>
																					<text fixtext="Page: ">
																						<styles font-weight="bold"/>
																					</text>
																					<field/>
																					<text fixtext=" "/>
																				</children>
																			</tgridcell>
																			<tgridcell>
																				<properties align="right"/>
																				<styles font-size="10pt" padding="0"/>
																				<children>
																					<text fixtext="Running Total of File Size: ">
																						<styles font-style="italic"/>
																					</text>
																					<autocalc xpath="sum( $AllFiles[position() &lt; $RowFrom]/@size )">
																						<styles font-style="italic" font-weight="normal"/>
																						<format basic-type="xsd" string="###,##0" datatype="integer"/>
																					</autocalc>
																				</children>
																			</tgridcell>
																		</children>
																	</tgridrow>
																	<tgridrow>
																		<children>
																			<tgridcell>
																				<styles padding="0"/>
																			</tgridcell>
																			<tgridcell joinleft="1"/>
																		</children>
																	</tgridrow>
																</children>
															</tgridbody-rows>
														</children>
													</tgrid>
												</children>
											</conditionbranch>
										</children>
									</condition>
									<newline/>
									<newline/>
									<tgrid>
										<properties border="1"/>
										<children>
											<tgridbody-cols>
												<children>
													<tgridcol>
														<styles width="0.83in"/>
													</tgridcol>
													<tgridcol>
														<styles width="2.31in"/>
													</tgridcol>
													<tgridcol>
														<styles width="2.17in"/>
													</tgridcol>
													<tgridcol>
														<styles width="1.80in"/>
													</tgridcol>
												</children>
											</tgridbody-cols>
											<tgridheader-rows>
												<children>
													<tgridrow>
														<children>
															<tgridcell>
																<children>
																	<text fixtext="File No."/>
																</children>
															</tgridcell>
															<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/>
																	<tgridcell>
																		<properties align="right"/>
																		<children>
																			<text fixtext="Total:">
																				<styles font-style="italic" font-weight="bold"/>
																			</text>
																			<text fixtext=" ">
																				<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="(number($RowFrom) -1) + position()"/>
																		</children>
																	</tgridcell>
																	<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/>
															<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="Total: ">
																						<styles font-style="italic" font-weight="bold"/>
																					</text>
																				</children>
																			</conditionbranch>
																			<conditionbranch>
																				<children>
																					<text fixtext="Total:">
																						<styles font-style="italic" font-weight="bold"/>
																					</text>
																					<text fixtext=" ">
																						<styles font-weight="bold"/>
																					</text>
																				</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>
									<newline/>
									<newline/>
									<condition>
										<children>
											<conditionbranch xpath="$CurrentPage!=1">
												<children>
													<tgrid>
														<styles width="100%"/>
														<children>
															<tgridbody-cols>
																<children>
																	<tgridcol>
																		<properties width="3in"/>
																		<styles width="50%"/>
																	</tgridcol>
																	<tgridcol>
																		<properties width="50mm"/>
																		<styles width="50%"/>
																	</tgridcol>
																</children>
															</tgridbody-cols>
															<tgridbody-rows>
																<children>
																	<tgridrow>
																		<styles height="0.15in"/>
																		<children>
																			<tgridcell>
																				<styles font-size="10pt" padding="0"/>
																				<children>
																					<text fixtext="Page: ">
																						<styles font-weight="bold"/>
																					</text>
																					<field/>
																					<text fixtext=" "/>
																				</children>
																			</tgridcell>
																			<tgridcell>
																				<properties align="right"/>
																				<styles font-size="10pt" padding="0"/>
																				<children>
																					<condition>
																						<children>
																							<conditionbranch xpath="$CurrentPage &lt; $CountOfPages">
																								<children>
																									<text fixtext="Running Total of File Size: ">
																										<styles font-style="italic"/>
																									</text>
																								</children>
																							</conditionbranch>
																							<conditionbranch>
																								<children>
																									<text fixtext="Final Total:">
																										<styles font-style="italic"/>
																									</text>
																									<text fixtext=" "/>
																								</children>
																							</conditionbranch>
																						</children>
																					</condition>
																					<autocalc xpath="sum( $AllFiles[position() le $RowTill]/@size )">
																						<styles font-style="italic" font-weight="normal"/>
																						<format basic-type="xsd" string="###,##0" datatype="integer"/>
																					</autocalc>
																				</children>
																			</tgridcell>
																		</children>
																	</tgridrow>
																	<tgridrow>
																		<children>
																			<tgridcell>
																				<styles padding="0"/>
																			</tgridcell>
																			<tgridcell joinleft="1"/>
																		</children>
																	</tgridrow>
																</children>
															</tgridbody-rows>
														</children>
													</tgrid>
												</children>
											</conditionbranch>
										</children>
									</condition>
									<newline/>
									<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;" enable-undo="0"/>
									<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;" enable-undo="0"/>
									<variable name="RowTill" value="$RowFrom + (if ($CurrentPage = 1 ) then $RowsOnFirstPage else $RowsPerPage) - 1" valuetype="&lt;auto&gt;" enable-undo="0"/>
								</variables>
							</template>
						</children>
						<variables>
							<variable name="AllFiles" value="//file" valuetype="&lt;auto&gt;" enable-undo="0"/>
							<variable name="RowsPerPage" value="25" valuetype="&lt;auto&gt;" enable-undo="0"/>
							<variable name="RowsOnFirstPage" value="20" valuetype="&lt;auto&gt;" enable-undo="0"/>
							<variable name="CountOfPages" value="( count( //file ) idiv $RowsPerPage ) + 1" valuetype="&lt;auto&gt;" enable-undo="0"/>
						</variables>
					</template>
				</children>
			</globaltemplate>
		</children>
	</mainparts>
	<globalparts/>
	<designfragments/>
	<xmltables/>
	<authentic-custom-toolbar-buttons/>
</structure>
