<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tt/onlinemanual/100110d" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Technical details</Title>
		<Keyword ContextSensitive="No"><Level1>Archiving</Level1>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>Reporting</Level1>
		</Keyword>
	</Header>
	<GeneralSection ID=""><Paragraph class="Default">This section contains an overview of the components of the ERP LN Report Archive solution, and describes their function in the report archiving and reprinting processes.</Paragraph>
		<List><ListIntro>Refer to the following sections for details:</ListIntro>
			<ListItem><Link href="#D1" role="internal">Tables</Link>
			</ListItem>
			<ListItem><Link href="#D2" role="internal">Sessions</Link>
			</ListItem>
			<ListItem><Link href="#D3" role="internal">Dlls</Link>
			</ListItem>
			<ListItem><Link href="#D4" role="internal">Log file</Link>
			</ListItem>
			<ListItem><Link href="#D5" role="internal">Data flow during first print</Link>
			</ListItem>
			<ListItem><Link href="#D6" role="internal">Data flow during reprint</Link>
			</ListItem>
			<ListItem><Link href="#D7" role="internal">Report splitting</Link>
			</ListItem>
			<ListItem><Link href="#D8" role="internal">Authorization for archive directories</Link>
			</ListItem>
		</List>
	</GeneralSection>
	<GeneralSection ID="D1"><SectionTitle>Tables</SectionTitle>
		<List><ListIntro>The solution contains the following tables:</ListIntro>
			<ListItem>Report Archiving Parameters (ttaad340) This table contains general settings, such as the base path for the archive, and is maintained through the <Link href="/baanerp/tt/aad/ttaad3140s000" role="session">Report Archiving Parameters (ttaad3140s000)</Link> session. This table must be created in company 000 only.</ListItem>
			<ListItem>Report Archive Groups (ttaad341) This table contains the settings, such as extension path and keywords, for the various report groups and is maintained through the <Link href="/baanerp/tt/aad/ttaad3541m000" role="session">Report Archive Groups (ttaad3541m000)</Link> session. This table must be created in company 000 only.</ListItem>
			<ListItem>Report Archiving Rules (ttaad342) This table contains the rules that determine which reports must be archived and is maintained through the <Link href="/baanerp/tt/aad/ttaad3542m000" role="session">Report Archiving Rules (ttaad3542m000)</Link> session. This table must be created in company 000 only.</ListItem>
			<ListItem>Archived Reports (ttaad345) This table contains details, such as the location of the print file and the report code, on the reports that are already archived. To view these details and reprint archived reports, use the <Link href="/baanerp/tt/aad/ttaad3545m000" role="session">Archived Reports (ttaad3545m000)</Link> and <Link href="/baanerp/tt/aad/ttaad3445m000" role="session">Print Archived Reports (ttaad3445m000)</Link> sessions respectively. You must create this table in all companies where reports must be archived.</ListItem>
		</List>
	</GeneralSection>
	<GeneralSection ID="D2"><SectionTitle>Sessions</SectionTitle>
		<List><ListIntro>The solution contains the following sessions:</ListIntro>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3140s000" role="session">Report Archiving Parameters (ttaad3140s000)</Link>
			</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3541m000" role="session">Report Archive Groups (ttaad3541m000)</Link> overview + editable details session</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3441m000" role="session">Print Report Archive Groups (ttaad3441m000)</Link>
			</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3542m000" role="session">Report Archiving Rules (ttaad3542m000)</Link> overview + editable details session</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3442m100" role="session">Check Report Archiving Rules (ttaad3442m100)</Link>
			</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3442m000" role="session">Print Report Archiving Rules (ttaad3442m000)</Link>
			</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3545m000" role="session">Archived Reports (ttaad3545m000)</Link> overview + editable details session</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3445m000" role="session">Print Archived Reports (ttaad3445m000)</Link>
			</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3445m100" role="session">Move/Delete Archived Reports (ttaad3445m100)</Link>
			</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3241m000" role="session">Export Archiving Settings (ttaad3241m000)</Link>
			</ListItem>
			<ListItem><Link href="/baanerp/tt/aad/ttaad3242m000" role="session">Import Archiving Settings (ttaad3242m000)</Link>
			</ListItem>
		</List>
	</GeneralSection>
	<GeneralSection ID="D3"><SectionTitle>DLLs</SectionTitle>
		<List><ListIntro>The solution uses the following DLLs:</ListIntro>
			<ListItem>ttdllreparch: A new DLL that is used to check whether a report must be archived and to reprint archived reports.</ListItem>
			<ListItem>ttstprepdll: This DLL already existed in <GUIRef href="/baanerp/tt" role="package">Tools</GUIRef> and was modified to support report archiving. This DLL splits a print job, depending on the report archiving rule, into various separate files.</ListItem>
		</List>
		<Paragraph class="Default">For details on report splitting, refer to: <Link href="#D7" role="internal">Report splitting</Link> and to the online Help of the <Link href="/baanerp/tt/aad/ttaad3542m000" role="session">Report Archiving Rules (ttaad3542m000)</Link> session.</Paragraph>
	</GeneralSection>
	<GeneralSection ID="D4"><SectionTitle>Log file</SectionTitle>
		<Paragraph class="Default">If errors occur during the archiving of a report, these errors are logged in the ${BSE}/log/log.reprint log file. Reading the content of this log file is useful if, due to a new report archiving rule, a report is archived for the first time.</Paragraph>
	</GeneralSection>
	<GeneralSection ID="D5"><SectionTitle>Data flow during first print</SectionTitle>
		<Paragraph class="Default">When a user issues a print command, the ttdllreparch DLL checks whether the Report Archiving Rules (ttaad342) table contains a rule that indicates that the report must be archived.</Paragraph>
		<Paragraph class="Default">If the report must be split, the ttstprepdll splits the print job, depending on the split expression specified in the rule.</Paragraph>
		<Paragraph class="Default">The split reports are saved as printer-independent files on the location that is specified in the <Link href="/baanerp/tt/aad/ttaad3140s000" role="session">Report Archiving Parameters (ttaad3140s000)</Link> session and the <Link href="/baanerp/tt/aad/ttaad3541m000" role="session">Report Archive Groups (ttaad3541m000)</Link> session. That location is: <Link href="/baanerp/tt/aad/ttaad3140s000#ttaad340.base" role="formfield">Base path for Archive</Link>/ <Link href="/baanerp/tt/aad/ttaad3541m000#ttaad341.extp" role="formfield">Extension path for Archive</Link>.</Paragraph>
		<Paragraph class="Default">The extension path can contain variables and is evaluated at the moment the files are written.</Paragraph>
		<Paragraph class="Default">For details on report splitting, refer to: <Link href="#D7" role="internal">Report splitting</Link> and to the online Help of the <Link href="/baanerp/tt/aad/ttaad3542m000" role="session">Report Archiving Rules (ttaad3542m000)</Link> session.</Paragraph>
	</GeneralSection>
	<GeneralSection ID="D6"><SectionTitle>Data flow during reprint</SectionTitle>
		<Paragraph class="Default">If a user issues a reprint command through the <Link href="/baanerp/tt/aad/ttaad3445m000" role="session">Print Archived Reports (ttaad3445m000)</Link> session, the user must select a device on which the report will be reprinted.</Paragraph>
		<Paragraph class="Default">Subsequently, the ttdllreparch DLL searches in the Archived Reports (ttaad345) table for the location of the print files. If the file is found, the report is reprinted on the selected device.</Paragraph>
	</GeneralSection>
	<GeneralSection ID="D7"><SectionTitle>Report splitting</SectionTitle>
		<Paragraph class="Default">When you print an ERP LN report, a temporary print file is always generated. This file contains the report layout and the data of the records to be printed.</Paragraph>
		<Paragraph class="Default">If you print a report that is selected to be archived, the report's temporary print file is usually split into several smaller print files, which are stored in the report archive folder The splitting is based on the <Link href="/baanerp/tt/aad/ttaad3542m000#ttaad342.splf" role="formfield">Split Expression</Link> that is defined in the report archiving rule.</Paragraph>
		<ExampleSection><SectionTitle>
                                 Example
                              </SectionTitle>
			<Paragraph class="Default">The Report Archiving Rules (ttaad342) table contains a rule that indicates that the invoice report must be archived. In this rule, the invoice number is selected as the <Link href="/baanerp/tt/aad/ttaad3542m000#ttaad342.splf" role="formfield">Split Expression</Link>.</Paragraph>
			<Paragraph class="Default">You run the Print Invoices session and print a range of 200 invoices. This results in a single temporary print file that contains the layout and the data for 200 invoices. The content of this temporary file is printed.</Paragraph>
			<Paragraph class="Default">Because the report must be archived, the temporary file is split into 200 separate files, one for each invoice, which are stored in the report archive folder.</Paragraph>
			<Paragraph class="Default">Later on, for example, after nine years, you can reprint any of these 200 invoices individually.</Paragraph>
		</ExampleSection>
	</GeneralSection>
	<GeneralSection ID="D8"><SectionTitle>Authorization for archive directories</SectionTitle>
		<Paragraph class="Default">Archived reports are stored in several subdirectories under the base path that is specified in the <Link href="/baanerp/tt/aad/ttaad3140s000" role="session">Report Archiving Parameters (ttaad3140s000)</Link> session. Usually each archive group has its own subdirectories.</Paragraph>
		<Paragraph class="Default">See also <Link href="/baanerp/tt/aad/ttaad3541m000#ttaad341.extp" role="formfield">Extension path for Archive</Link> and the online Help of the <Link href="/baanerp/tt/aad/ttaad3541m000" role="session">Report Archive Groups (ttaad3541m000)</Link> session.</Paragraph>
		<Paragraph class="Default">A user can only archive a report, if the user has write authorization for the directory (base path/extension path) in which the report will be stored.</Paragraph>
		<Paragraph class="Default">To avoid authorization problems, verify that all users have write authorization for all subdirectories under the base path.</Paragraph>
	</GeneralSection>
</ManualTopic>
