Summary

This article covers PDF reports.


Table of Contents


PDF reports are intended for the generation of simple PDF documents.
A PDF report can be created for a single study or for the complete application.
Example: the query PDF feature is available for all studies of the business platform. It can however he overridden on any level allowing for a modified, reduced or extended layout of the generated PDF report.

The document element of a PDF report definition is a pdfReport. You might want to traverse the defintion of a PDF report to understand the possibilities that simple PDF reporting offers. In short: a data provider generated data from the context where it is created. The PDF report specifies the layout and how the data fields should be used.

As an example, please review this Query PDF a possible output of this functionality. An example of the XML configuration for a report like that PDF would be similar to this.


Element body

The body is the construction plan for the report output. It is applied to every data record. Example: If the data provider holds 18 data records, then the body is used 18 times to construct the output.

This is a sequence (max: unbounded) of

Attribute font [optional] : xsd:string

Here you can use the name of a font that should be used as default for the complete body. Fonts can be overridden at any level.

Element cell

The cell element specifies the appearance of a cell in the context of a table.

This is a sequence (max: unbounded) of

Attribute font [optional] : xsd:string

Attribute underline [optional] : xsd:boolean

When underline is activated, then the complete cell has a lower border. This does not mean that the content uses an underlined font!

Attribute ifField [optional] : xsd:string

A field specifies a value that the data provider will return.
You might want to specify a field name here, when you want to generate the cell if and only if the field value exists. This means: If the field holds an object value, then the object needs to exist (no null values). If the field is a string field, then the string may not be empty. If the field is a list field, then at least one element needs to exist.

Element chunk

A chunk element combines textual content with a font for the output.

This is a sequence (max: 1) of

Attribute font [optional] : xsd:string

You can use a symbolic font name here. If you do so, the font will be used for the chunk. Otherwise the most recent font attribute from list of ancestors is used.

Attribute ifField [optional] : xsd:string

A field specifies a value that the data provider will return. You might want to specify a field name here, when you want to generate the chunk if and only if the field value exists. This means: If the field holds an object value, then the object needs to exist (no null values). If the field is a string field, then the string may not be empty. If the field is a list field, then at least one element needs to exist.

Element customData

The customData element allows the specification of a data provider class. This way any class on any level can be used. It is only required that the class implements the PDFReportDataProvider interface. Specify a custom data provider only, if instructed to do so.

Attribute class [required] : xsd:string

This is the class name data provider to use.

Element data

This element specified the data provider to use.

This is a sequence (max: 1) of

  • Element standardData [min: 0] [max: 1]
  • Use this element, when there is a standard data provider in the
    core application that can be used.

  • Element customData [min: 0] [max: 1]
  • Use this element, when the data provider class needs to be named. Specifying the class allows using a custom data provider that
    might exist for a single study only.

Element field

The field element represents the data that the data provider holds for the field name.

Attribute name [required] : xsd:string

The field name for the data. Possible field names depend on the data provider.

Attribute removeHtml [optional] : xsd:boolean

Some fields might contain html content. With the usage of this attribute (set to true) you can remove anything that looks like
an html field from the result. Example: Question text from the data architect file. Do not use this on fields that might contain clinical data as this might remove important clinical information from the result.

Element font

A font element sets a name for a font that should be used in the PDF report. For the font you can specify the size and the style. A combination of styles is not possible.

Attribute name [required] : xsd:string

This is a name for a font. This name can be used as value for the font attribute of many other elements.

Attribute size [optional] : xsd:integer

Specify a size for the font to use.

Attribute style [optional] : fontStyle

Specify a style for the font to use.

Element fontList

The font list defines a number of named fonts to use.
PDF reports allow the definition of fonts for the complete report. Fonts defined here are used with the name that is
assigned to them here. PDF reports do not allow the construction of a new font for some nested element outside of this list.

This is a sequence of

This element defines the footer. For the page footer of a PDF report only a limited number of simple options is available. It is important to note that the footer does not support line breaks within one footerLine element! Thus the space per line should be limited to short values. Otherwise the text might be printed over the right border of the text area.

This is a sequence of

Element footerLine

The footerLine element lets you specify the content for one line of the footer.
A footer line cannot be broken into multiple lines. There is only a small number of formatting elements that can be used. Use only small strings as the output might break the right border for the page.

This is a sequence (max: unbounded) of

Attribute ifField [optional] : xsd:string

A field specifies a value that the data provider will return.
You might want to specify a field name here, when you want to generate the footer line if and only if the field value exists. This means: If the field holds an object value, then the object needs to exist (no null values). If the field is a string field, then the string may not be empty. If the field is a list field, then at least one element needs to exist.

Element htmlCell

The htmlCell element specifies the appearance of a cell in the context of
a table. Opposed to the cell element, this cell kind supports a limited
number of html tags.

This is a sequence (max: unbounded) of

Attribute font [optional] : xsd:string

Attribute underline [optional] : xsd:boolean

When underline is activated, then the complete cell has a lower border. This does not mean that the content uses an underlined font!

Attribute ifField [optional] : xsd:string

A field specifies a value that the data provider will return.
You might want to specify a field name here, when you want to generate the html cell if and only if the field value exists. This
means: If the field holds an object value, then the object needs to exist (no null values). If the field is a string field,
then the string may not be empty. If the field is a list field, then at least one element needs to exist.

Element localize

A localize element will represent a string that is localized with the user’s locale that is running the report. The key that is specified here needs to be a known internationalization (i18n) key for the application. Depending on the key additional parameters might need to be filled. There are ten parameter supported numbered from 0 to 9. For oneparameter you can either specify an i18n key or a (data) field value.

Attribute key [required] : xsd:string

You need to specify an i18n key here. You will probably need advicev on the valid i18n keys for the application.

Attribute p0key [optional] : xsd:string

If the i18n key requires a parameter 0, then you can specify another i18n key here. The key is localized and used as value for parameter 0.

Attribute p0field [optional] : xsd:string

If the i18n key requires a parameter 0, then you can specify a data field name here. The value of the data field is used as value for parameter 0.

Attribute p1key [optional] : xsd:string

Same as p0key, but for parameter 1.

Attribute p1field [optional] : xsd:string

Same as p0field, but for parameter 1.

Attribute p2key [optional] : xsd:string

Same as p0key, but for parameter 2.

Attribute p2field [optional] : xsd:string

Same as p0field, but for parameter 2.

Attribute p3key [optional] : xsd:string

Same as p0key, but for parameter 3.

Attribute p3field [optional] : xsd:string

Same as p0field, but for parameter 3.

Attribute p4key [optional] : xsd:string

Same as p0key, but for parameter 4.

Attribute p4field [optional] : xsd:string

Same as p0field, but for parameter 4.

Attribute p5key [optional] : xsd:string

Same as p0key, but for parameter 5.

Attribute p5field [optional] : xsd:string

Same as p0field, but for parameter 5.

Attribute p6key [optional] : xsd:string

Same as p0key, but for parameter 6.

Attribute p6field [optional] : xsd:string

Same as p0field, but for parameter 6.

Attribute p7key [optional] : xsd:string

Same as p0key, but for parameter 7.

Attribute p7field [optional] : xsd:string

Same as p0field, but for parameter 7.

Attribute p8key [optional] : xsd:string

Same as p0key, but for parameter 8.

Attribute p8field [optional] : xsd:string

Same as p0field, but for parameter 8.

Attribute p9key [optional] : xsd:string

Same as p0key, but for parameter 9.

Attribute p9field [optional] : xsd:string

Same as p0field, but for parameter 9.

Element now

The now element is a special timestamp value for the current time. For the execution of a report only one timestamp value is used as now. Thus, if a report specifies the now timestamp in the footer line, then it will always hold the same value for the complete report (not dependent on the report runtime).

Attribute format [optional] : xsd:string

Attribute timeZone [optional] : xsd:string

Element paragraph

A paragraph element specifies how a paragraph for the output
should be constructed.

This is a sequence of

Attribute alignment [optional] : alignment

Attribute font [optional] : xsd:string

Use the symbolic name as specified in the PDF report’s font list. Fonts might be overridden on any level.

Attribute ifField [optional] : xsd:string

A field specifies a value that the data provider will return. You might want to specify a field name here, when you want to
generate the paragraph if and only if the field value exists. This means: If the field holds an object value, then the object needs to exist (no null values). If the field is a string field, then the string may not be empty. If the field is a list field, then at least one element needs to exist.

Element pdfReport

The pdfReport element is the root element of a PDF report definition. It specifies how data is provided, what font names can be used, how the footer should look like and how the body for each data record should be constructed. Furthermore application properties can be specified or overridden.

This is a sequence of

  • Element properties [min: 0] [max: 1]
  • The properties element allows overriding or adding the application
    properties.

  • Element data [min: 1] [max: 1]
  • One data element is required to specify on which data the report
    is running.

  • Element fontList [min: 0] [max: 1]
  • The fontList allows specifying the fonts that can be used later
    throughout the document.

Element properties

Each application allows the definition of properties. With a PDF report you can override or add new properties for the execution of the PDF report only. Each property requires one property element as child of this collection.

This is a sequence of

Element property

Use a property element to map a property key to a value. This property will override the normal application properties for the execution of the PDF report. Example: You might want to specify a special studyDateFormat only for a single report.

Attribute key [required] : xsd:string

Attribute value [optional] : xsd:string

Element recordName

The recordName element returns the name of a record as defined the data architect file. Common examples are Subject or Patient.

Element space

An element space specifies vertical empty space on the resulting output. The resulting space depends on the currently active font. It is the amount of space that one line with the active font would require to print.

Attribute height [optional] : xsd:string

The height attribute is currently now supported. It has been added for future usage.

Attribute ifField [optional] : xsd:string

A field specifies a value that the data provider will return. You might want to specify a field name here, when you want to generate the space if and only if the field value exists. This means: If the field holds an object value, then the object
needs to exist (no null values). If the field is a string field, then the string may not be empty. If the field is a list field, then at least one element needs to exist.

Element standardData

The standardData element is used to specify the usage of a data provider that is build permanently into the application. You need the specify the symbolic name of the data provider. We have intentionally used a string type here and no enumeration value as this allows adding new standard data provider without the need to change the schema definition. Currently the following standard data providers are available:

  • query – This data provider retrieves
    basic query data. It does not add any question or query audit
    trail data. Thus it runs more efficiently than the versions that
    need to retrieve audit trail data.
  • queryQryAuditTrail – This data provider retrieves basic query
    data combined with audit trail data for the query.
  • queryQstAuditTrail – This data provider retrieves basic query
    data combined with audit trail data for the question.
  • queryQryQstAuditTrail – This data provider retrieves basic query
    data combined with audit trail data for the question.

As outlined above, there might be other standard data provider available or added by request.

Attribute name [required] : xsd:string

Use the known name for a standard data provider here.

Element string

A string element allows the specification of a constant literal string value.

Attribute value [required] : xsd:string

Element studyName

The studyName element returns the name of the current study.

Element table

A table element stands for collection of cells that are written to the output. A table can contain at most one tableHeader and
a table data. The header is independent of field data, while the table data requires special list data field values. A table does not support any rows. It is just a collection of cells that are put side by side until the number of cells is filled, then the next line is started. The number of columns depends on the attribute columnWidthList.

This is a sequence of

Attribute columnWidthList [required] : xsd:string

This attribute defines the number of columns and the column width for each column. This needs to be a comma separated value of column width values. Example: “120,60,60″. The number of width values is the number of columns for the table. For the example the table would contain three columns and the first column would have double the size of the second and third column.

Attribute widthPercentage [optional] : xsd:integer

Specify a percentage value for the width of the table here. A value of 100 will result in a table that takes the complete available width.

Attribute border [optional] : xsd:integer

Specify the size of a border here. Use 0 for no border.

Attribute font [optional] : xsd:string

Attribute ifField [optional] : xsd:string

A field specifies a value that the data provider will return. You might want to specify a field name here, when you want to generate the table if and only if the field value exists. This means: If the field holds an object value, then the object needs to exist (no null values). If the field is a string field, then the string may not be empty. If the field is a list field, then at least one element needs to exist.

Element tableData

The tableData element specifies the dynamic content for a table. A field need to be specified, where the field data is a list of other fields. For each item of the data list one set of tableData cells is generated. One item of the list specified new data fields for the context of the table data. Example: A data provider can specify data fields for one query. Under the data field “queryAudits” it might provide a list of audit data. In each item of the list (audit data item) there are new fields with data like “time”, “user”, “action”. Important: The available fields in a cell for a tableData element are different to the fields outside of the table data.

This is a sequence (max: unbounded) of

Attribute field [required] : xsd:string

This needs to be the name of the field that holds a list of data fields.

Attribute font [optional] : xsd:string

Attribute ifField [optional] : xsd:string

A field specifies a value that the data provider will return. You might want to specify a field name here, when you want to
generate the table data if and only if the field value exists. This means: If the field holds an object value, then the object needs to exist (no null values). If the field is a string field, then the string may not be empty. If the field is a list field, then at least one element needs to exist.

Element tableHeader

The tableHeader element specifies the constant cells on top of a table. These cells do not depend on a list type data field. They are written to the table once at the beginning of the table. Be advised that this does not mean that these cells are repeated on any page. It is possible to use a tableHeader for a table without a tableData element.

This is a sequence (max: unbounded) of

Attribute font [optional] : xsd:string

Attribute ifField [optional] : xsd:string

A field specifies a value that the data provider will return. You might want to specify a field name here, when you want to
generate the table header if and only if the field value exists. This means: If the field holds an object value, then the object needs to exist (no null values). If the field is a string field, then the string may not be empty. If the field is a list field, then at least one element needs to exist.

Element timeStamp

The timeStamp element is used for field data that needs to be handled as timestamp. Timestamps are different to other data as a format and a time zone might need to be applied to display the value.

Attribute field [required] : xsd:string

Attribute format [optional] : xsd:string

Attribute timeZone [optional] : xsd:string

Simple Type alignment

The alignment type allows the specification of predefined alignment values.

Choice ‘left‘.

An alignment to the left side should be used.

Choice ‘right‘.

An alignment to the right side should be used.

Choice ‘center‘.

A centered alignment should be used.

Simple Type fontStyle

Choice ‘normal‘.

Use this value when you want to use a normal font style.

Choice ‘bold‘.

Use this value when you want to use a bold font style.

Choice ‘bolditalic‘.

Use this value when you want to use a bold and italic font style.

Choice ‘courier‘.

Use this value when you want to use an courier font style.

Choice ‘helvetica‘.

Use this value when you want to use a helvetica font style.

Choice ‘italic‘.

Use this value when you want to use an italic font style.

Choice ‘strikethru‘.

Use this value when you want to use a font style that is stroked thru.

Choice ‘underline‘.

Use this value when you want to use an underlined font style.


Need more help?

Please visit the Fountayn Contact Information page.