Import

Import a BIRT report

What brevier import reads from a BIRT .rptdesign file, which parts of the report it converts and which it names.

On this page

Community

brevier import kontoauszug.rptdesign -o templates/kontoauszug
Imported kontoauszug.rptdesign: wrote kontoauszug.html, kontoauszug.css, kontoauszug.schema.json, sample.json

The import writes the same four files as for JasperReports. The Example shows what each of them holds.

The BIRT version of the Kontoauszug keeps its header as a text element at the top of the body, then a table, then a text element with the footer. The import keeps this order:

kontoauszug.html
<div><h1>{{bankName}}</h1>
<p>{{kontoinhaber}}</p>
<p>IBAN: {{iban}}</p>
<!-- 5 more lines -->
<p>Neuer Kontostand: {{neuerKontostand}} EUR</p></div>
<table class="report-table" data-brevier-uebertrag="true">
  <!-- thead and {{#each rows}} ... {{/each}} -->
</table>
<div><p>{{bankName}} · Kontoauszug</p></div>

What the import reads

In the report In the template
A scalar parameter A property of the schema, with its type.
A scalar parameter with isRequired false or with a default value A property that the schema does not require.
The columns of the data set of the first table (a script data set or an oda-data-set) The properties of rows.
A label in the body A paragraph <p>.
A text element with HTML (contentType html, or auto with a tag in the text) A <div> with the HTML. <value-of>params["x"]</value-of> becomes {{x}}.
A text element with plain text A paragraph <p>.
The first table: the first row of the header and the first row of the detail <thead> and {{#each rows}} ... {{/each}}.
A cell with a data element that reads dataSetRow["x"] or row["x"] {{x}}
The page size of the first master page (a3, a4, a5, us-letter, us-legal or custom), the orientation and the margins @page in the CSS.

The data types integer, float, decimal, boolean, date and dateTime map to the schema types integer, number, number, boolean, a string with format date and a string with format date-time. Any other type is a string.

Labels and texts before the first table go before the table in the template. Labels and texts after it go after the table. As in the JasperReports import, a column of a number type is right-aligned, and the first column of a decimal type (not integer) carries its total to the next page.

What the import names

Everything that the table above does not read is named with its line. Add <property name="textAlign">right</property> to the label of a header cell, and the import prints:

Not converted: line 124: property "textAlign"

These are the parts that you meet most often:

In the report What you do
Style properties of a label, text or cell, such as fontSize, color or textAlign Write the rule in the CSS.
The page header and the page footer of the master page Write them as running blocks in the template: see Page layout.
A script in a data set Your application passes the rows.
A second table, a grid, a chart, an image and every other body element Write the HTML by hand.
A table row after the first row of the header or the detail Write the row in the template.
A bound column with a script or an aggregate function, and a cell that reads it Your application computes the value and passes it.
A default value of a parameter The property is optional in the schema. Your application passes the value.
A parameter that is not a scalar parameter Your application passes the value.

A value that has no template syntax is computed by your code and passed as a new root of the data. The schema lists it. The Ways out page shows this for JasperReports, and it works the same way here.

Next: Replace the call.