The report Command
The
report
command is used to interact with report objects. The purpose of report objects is to generate reports in PDF or HTML format from structure data. PDF files can contain a hidden structure-searchable database with the structure and rendered or auxiliary data items.
The format of a report is defined by an XML style file, which describes a record box with arbitrary positioning of data or image fields. These record boxes can be stacked horizontally and vertically on report pages. The XML style file is embedded in PDFs written by report objects, so these files can contain both human-readable and computer-readable data content plus the layout information used to generate the file. It is for example possible to re-render content with a different style file, or use the style file extracted from a template file to render additional documents in exactly the same style.
The unit for describing report object placements are 72 DPI pixels. The are converted and/or scaled to the selected output format.
report create
report create ?attribute value?...
Create a new report object. Additionally, an set of attributes of the object may be defined in the same statement. The settable attributes are the same as in the
report set
command.
The command returns the handle of the new report object.
report delete
report delete ?handle?...
report delete all
Delete one of more report objects which are identified by their handles. The second variant deletes all currently defined report objects.
Example:
report delete {*}[report list]
This command is equivalent to
report delete all
.
report get
report get handle attribute
Query an attribute of a report object. The currently supported attributes are:
-
affiliation
The institution the author of the report works for.
-
author
The author of the report, as free-form text.
-
authorurl
A URL with information on the author, or an empty string if unset.
-
border
The distance between the paper or HTML page and the first elements of a data box.
-
boundingbox
A list of the upper left x/y and lower right x/y coordinates of the current layout, with all scaling and offset computations applied. This is a read-only attribute.
-
category
A category string to be used if the report definition is stored in a repository.
-
classuuid
The base class UUID of this report.
-
comment
A free-form comment.
-
date
The date of the last change of the report.
-
dbfields
A nested list of the columns defined for the embedded structure and reaction database. Each field is reported as a list of the property or pseudo-property name of the field, the true database column name, a bitset set of any database field attributes set on the field (from the bit set of
none
,
index
,
unique
,
notnull
,
nocompute
), the name of the
SQLITE
database type used to encode the field, and the field length, which is zero if it is not defined.
If database fields have not yet been defined on the report object, querying or setting this attribute instantiates a standard set for a structure (but not reaction) database. Additionally, all properties currently associated with a data display field in the layout are automatically added, so that every visible data value can also be read from the database.
When setting this attribute, every field sublist must contain only between one and three elements. The last two items reported are automatically deduced from the type of data to be stored. If no explicit field name is specified, the field name is copied from the first argument. If no third element is supplied, the database column has no auxiliary SQL attributes, i.e. it is not indexed, may contain multiple entries of the same value, can be
NULL
, and an attempt will be made to compute its value when a structure or reaction record is written and the ensemble or reaction does not currently hold a value for the property or pseudo-property of the database column.
-
dbfilename
The name of the
SQLite
database file with the structure- and data-searchable content associated with this report object. It can also be set, though usually its name is auto-generated. Initially, an empty return value indicates that no file name has been set.
-
doi
A digital object identifier for the report, if defined.
-
email
An email contact address of the author.
-
eolchars
The end-of-line character to use in ASCII-formatted output, such as the HTML report style. The default value is the platform style (Windows, Mac or Unix/Linux). It can be set to any string. Additionally, the magic values
win
(or crlf), mac (or
cr
) and
linux
(or
unix
, or
lf
) are recognized.
-
footer
The center-aligned page footer text, which can contain placeholders. The default is an empty string.
-
header
The center-aligned page header text, which can contain placeholders. The default is an empty string.
-
htmlfilename
The name of the file with the
HTML
-formatted rendering of the report content. Usually, this is automatically set. The initial value is an empty string, which results in an automatically generated name if a
HTML
file is written.
-
infourl
A URL with information on the report, or an empty string if unset.
-
keywords
A list of keywords associated with the report
-
leftfooter
The left-aligned page footer text, which can contain placeholders. The default is an empty string.
-
leftheader
The left-aligned page header text, which can contain placeholders. The default is an empty string.
-
versionuuid
The instance UUID associated with this report
-
license
The license class associated with this report. Setting the license to a standard type updates the associated
URL
with a standard location.
-
licenseurl
A
URL
with details about the report license.
-
literature
This is a free-form string for a literature reference describing the meaning and/or algorithm behind the report.
-
maxpages
The maximum number of pages to write, in
PDF
or
HTML
format. If the current data set is too large to fit into this number of pages, the rest is silently omitted. A negative value, which is the default, allows an unlimited number of pages. In any case, the maximum page count of a
PDF
report is 9999 pages. This is due to a limitation in the
PDF
rendering library.
-
maxrecs
The maximum number of records to write, which is the same as the number of top-level data boxes. The actual size of the dataset or structure file used as data source for the report may be larger, if a filtering mechanism, such as selection processing, is set. Records in excess of the maximum are silently omitted. A negative value, which is the default, allows an unlimited number of records.
-
name
The primary name of the report.
-
orcid
The
ORCID
code of the author of the report (see www.orcid.org).
-
orientation
The page orientation, which can either be
portrait
(the default) or
landscape
.
-
ownerpassword
The owner password for generated
PDF
files. An empty string, which is the default, indicates that no password is set. For
HTML
output, this attribute is ignored.
-
paper
The size of paper, such as A4, A3 or letter, which is used to format the output as PDF or
HTML
. This parameter has an effect even on
HTML
output, since the code contains page breaks for nice printing. The default is the toolkit default paper, which itself is usually A4 or letter.
-
path
The repository path for displaying hierarchical repository trees. This attribute is independent of any file system paths.
-
pdffilename
The name of the file with the
PDF
-formatted rendering of the report content. Usually, this is automatically set. The initial value is an empty string, which results in an automatically generated name if a
PDF
file is written.
-
references
Cross references of the report. This is a nested list of class UUIDs and reference type tags.
-
regid
For registered reports, the registration ID. Unregistered modules report zero.
-
rightfooter
The right-aligned page footer text, which can contain placeholders. The default is an empty string.
-
rightheader
The right-aligned page header text, which can contain placeholders. The default is an empty string.
-
scale
A scaling factor to convert the 72-DPI internal coordinates to print coordinates. The default scale is 1.0. If set, the magic value #
auto
is also recognized, which sets the scaling factor so that the configured number of horizontal and vertical blocks with the current style file just fit onto the configured paper type. Please refer also to the interacting
xblocks
and
yblocks
attributes. Automatic setting of this attribute is only possible if a style file has been read, because it requires the box layout data.
-
spacing
The number of pixels between top-level data boxes if more than one is stacked in x or y direction. The default spacing is 1.
-
styledata
The contents of the current style file, in original
XML
formatting. This data can be set either directly as a string, or indirectly via the
stylefilename
attribute. If set directly, the
stylefilename
attribute is reset.
-
stylefilename
The name of the
XML
file with report render style information. Its initial value is an empty string. If this attribute is set, the file contents are parsed and stored internally. The file contest are then available as in the
styledata
attribute.
-
title
The title of the report as a free-form string. In
HTML
reports, it is used as page title. In
PDF
, it is part of the document metadata.
-
userpassword
The user password for
PDF
documents. By default, it is an empty string, which means that no password is set. For
HTML
output, the attribute is ignored.
-
version
A version string
-
versionuuid
The version
UUID
associated with this report version.
-
xblocks
The number of top-level data boxes to arrange in horizontal direction on a document page. When it is set, the magic words #
auto
is recognized, which computes the maximum number of boxes which can be placed without overspill on the page using the current border, spacing and scaled top-level box size. Please refer also to the interacting scale attribute. Automatic setting of this attribute is only possible if a style file has been read, because it requires the box layout data.
-
yblocks
The number of top-level data boxes to arrange in vertical direction on a document page. When it is set, the magic words #
auto
is recognized, which computes the maximum number of boxes which can be placed without overspill on the page using the current border, spacing and scaled top-level box size. Please refer also to the interacting scale attribute. Automatic setting of this attribute is only possible if a style file has been read, because it requires the box layout data.
report list
report list ?pattern?
Return the handles of all currently defined report objects. The handles may optionally be filtered by a standard Tcl string match condition.
report set
report set handle ?attribute value?...
Set attributes of the report object. The attributes are explained in the section on the
report get
command.
Example:
report set $rhandle stylefile „mystyle.xml“ paper A4 xblocks 2 yblocks #auto \ scale #auto
This is a typical page set-up operation. The PDF or HTML form of the report will contain 2 top-level boxes arranged horizontally, a suitable (as computed from the aspect ratio of the paper) number of vertically stacked blocks, and everything scaled so that either the horizontal or vertical extent of the block stacks, plus the border, just fit onto the selected paper, without overspill.
report subcommands
report subcommands
Return a list of all subcommands of report objects. The command does not have any parameters.