Technical details

This section contains an overview of the components of the LN Report Archive solution. It describes their function in the report archiving and reprinting processes.

Tables

The solution contains these tables:

  • Report Archiving Parameters (ttaad340). This table contains general settings, such as the base path for the archive. The table is maintained through the session and must be created in company 000 only.
  • Report Archive Groups (ttaad341). This table contains the settings, such as extension path and keywords, for the various report groups. The table is maintained through the session and must be created in company 000 only.
  • Report Archiving Rules (ttaad342). This table contains the rules that determine which reports must be archived and is maintained through the session. This table must be created in company 000 only.
  • 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 and sessions respectively. You must create this table in all companies where reports must be archived.

Sessions

The solution contains these sessions:

  • overview + editable details session
  • overview + editable details session
  • overview + editable details session.

DLLs

The solution uses these DLLs:

  • ttdllreparch: A new DLL that is used to check whether a report must be archived and to reprint archived reports.
  • ttstprepdll: This DLL already existed in Tools and was modified to support report archiving. This DLL splits a print job, depending on the report archiving rule, into various separate files.

See "Report splitting" and the online Help of the session.

Log file

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.

Data flow during first print

When running a print command, the Report Archiving Rules (ttaad342) table is checked. The ttdllreparch DLL checks whether it contains a rule to archive the report.

If the report must be split, the ttstprepdll splits the print job, depending on the split expression specified in the rule.

The split reports are saved as printer-independent files on the location that is specified in these sessions:

That location is: / .

The extension path can contain variables and is evaluated at the moment the files are written.

See "Report splitting" and the online Help of the session.

Data flow during reprint

If you run a reprint command through the session, you must select a device on which the report must be reprinted.

Then, 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.

Report splitting

When you print an LN report, a temporary print file is always generated. This file contains the report layout and the data of the records to be printed.

If you print a report that is selected to be archived, the report's temporary print file is split into several smaller print files. They are stored in the report archive folder. The splitting is based on the that is defined in the report archiving rule.

Example

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 .

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.

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.

Later on, for example, after nine years, you can reprint any of these 200 invoices individually.

Authorization for archive directories

Archived reports are stored in several subdirectories under the base path that is specified in the session. Usually each archive group has its own subdirectories.

See the session and the online Help of the session.

You can only archive a report, if you have write authorization for the directory, base path/extension path, in which the report is stored.

To avoid authorization problems, verify that all users have write authorization for all subdirectories under the base path.