ReportBro Designer User Guide

Page structure

ReportBro Designer is divided into 4 sections:
  1. Menu bar: Holds all toolbar buttons, elements to be dragged and dropped into the template, alignment buttons in case several elements are selected, and the button to show or hide the grid. The menu bar is either displayed horizontally on top of ReportBro Designer or vertically on the right as a sidebar.
  2. Menu panel: Contains all added elements within header, content and footer that have been dragged into the template; parameters, predefined text styles and overall document properties. Drag & drop elements within the menu panel to rearrange them.
  3. Detail panel: Offers possible configuration options for the selected element.
  4. Document panel: Represents the visual representation of the designed report. It contains the report template, the PDF preview in case the preview is triggered and the link to download an XLS preview file if available.

Design elements

You can add design elements to your template simply by dragging & dropping them from the menu bar into the template. Once dropped in the template (and selected) it can be configured - all available configuration options for that element are visible within the detail panel. You may select an element by clicking on it in the template itself or by selecting it in the menu panel.
When selecting various elements together, alignment buttons appear in the menu bar allowing to align the elements to each other.
Element Description
Text A text element can consist of static text, parameters, a combination of both or an expression to be evaluated (see expression syntax for usage details. Predefined styles templates can be applied to text as well.
Horizontal line A horizontal line is a simple design element that can be adjusted in regards of its width, height and color.
Image ReportBro supports image types png and jpg with file extensions png, jpg and jpeg. An image file can be added statically by uploading, defining a text parameter with an URL as source (must start with http:// or https:// and end with its file extension) or defining an image parameter. When printing, images are scaled proportionally to keep aspect ratio and maintain printing quality. Thus, an image can be resized max. to its actual height and width (no stretching).
Table A table is used to display a list of values, e.g. for invoices, statistics, shipping items. Therefore, a table always needs a parameter list as data source. One click on the table selects the table itself, double click into the table selects a content element.

Tables can be configured on different levels:
Table element itself: Data source setting, position, amount of columns, border, enabling/disabling table header and footer
Table header and footer element (if enabled): Row height, background color. Table header can also be repeated on every page in case the table spreads over more than one page.
Table content element: Alternating row background colors, set "Always on same page" to prevent row splitting on page break.

Configuring and styling the contents of a table is done the same way as for text elements. Have a look at the Invoice and Delivery slip demos to see how to use tables.
Barcode ReportBro currently supports Code128 as barcode being one of the most versatile barcodes and supporting all 128 ASCII characters. See ASCIItable.com for a list of supported characters. Have a look at the Delivery slip demo to see usage of a barcode.
Frame A frame is a container for other elements and stretches according to its contents. It can be used to group elements and keep them together (a frame doesn't split on page break) and to apply a border or background to the whole frame. All elements of a frame are positioned in relation to the frame whereas the frame itself is positioned in relation to the page. Therefore, moving the frame also moves its contents. Invoice and Delivery slip demos both use frames.
Section A section allows to print grouped lists of values. It needs a parameter list as data source just as a table. The difference to a table is, however, that a section can contain multiple elements to be grouped whereas a table displays data line by line. A section can be forced to be always printed on the same page

Sections can be configured on different levels:
Section element itself: Data source setting, position, enabling/disabling section header and footer
Section header, content and footer element: Height, shrink content to height. Set "Always on same page" to prevent element splitting on page break. Section header can also be repeated on every page in case the section spreads over more than one page.
Page break A manual page break

Document settings

Page document settings provide the means for the general document setup by defining page format and orientation, margins for the printable area, configuration of page header and footer (enabling/disabling, size and display option), pattern locale (used when a date or number is formatted with a pattern - see also patternLocale option) and currency symbol in case a currency symbol is used with a number pattern.

Specific settings

Conditional Styles, Print condition
You may set different behavior for styling text elements and printing based on evaluating an expression (see expression syntax for details on how to write expressions). Conditional styles are useful e.g. for highlighting a value if it is outside a certain treshold. Print conditions may be helpful e.g. to address different payment terms on invoices based on tax rates or invoice amounts.
Print settings
  • Remove when empty: Removes the whole element in case it is empty (or its expression results in an empty element). Hence it does not occupy the predefined space and all following elements move upwards accordingly.
  • Always on same page (only available for text elements and table content rows): Prevents splitting of text in case of a page break
  • Pattern: Applies a number or date pattern. Use this setting to override the default pattern set for a parameter. It can also be set to format a date or number parameter that is used within a text element aside static text.

Spreadsheet settings

These settings allow basic definition of the data for xlsx spreadsheets. Spreadsheet reports in ReportBro mainly serve the purpose to display lists of data, such as analysis tables and statistics. By default a report layout is transferred to xlsx line by line but you may decide whether to omit selected elements from exporting to xlsx at all (hide), place an element into a fixed column (this field takes a number), or to add an empty row below the element.

Patterns

Use patterns to format number and date parameters. ReportBro displays a predefined set of patterns but you may also use your own as long as you comply with the Date Pattern Syntax.
In case you are configuring ReportBro for your users consider predefining the patterns for your users need. Have a look at the pattern options for details.

Parameters

Parameters are used to parse data from your application to ReportBro in order to fill the report with dynamic data. ReportBro offers different parameter types that you can also use to evaluate expressions. Number parameters also support calculations, although it is recommended to use ReportBro as a presentation tool rather than a calculation tool (in order avoid discrepancies with your application data due to different calculus, rounding issues or the like). You may apply patterns on date and number parameters which are used as defaults whenever the parameter is added as an element to the report template. However, you may override the pattern of a designated element in its print settings.
By activating the "Nullable" setting you can allow the parameter value to be set to the special value null instead of an actual value. A parameter that is not nullable and has no assigned value will automatically get a default value assigned (e.g. current date for date parameter, 0 for number parameter).
Type Description
Text Takes any string.
Number Numbers are interpreted for calculations as decimals, but can be formatted using patterns.
Boolean True or false value.
Date Takes datetime.date or datetime.datetime or string in ISO 8601 standard format (YYYY-MM-DD for date, YYYY-MM-DD HH:mm for datetime)
Dates can be formatted using patterns.
Image Using an image parameter instead of a URL or uploaded file.
List Contains a list of parameters. A list can only be used together with a table or section element to represent the data from the list. However, a table or section may also contain other parameters than of its list data source. Please also have a look at table element and section element for further details.
Simple List Contains a list of parameters of one specific type (text, number, boolean or string).
Collection Contains a logical grouping for text, number, date, sum and average parameters. You may e.g. create a collection named "Client" that contains all address and contact details of your client.
Sum Provides the calculated sum of a list parameter of type number. A parameter to use for calculation must be set as expression and only parameters of type number from a list can be used.
For individual calculations use a parameter of type number and create your own expression.
Average Calculates the average of a list of numbers. A parameter to use for calculating the average must be set as expression and only parameters of type number from a list can be used.

Expression syntax

Expressions must be valid python statements and can contain parameters. Parameters used for expressions consider their respective type (e.g. a parameter text represents a string in python, a parameter number represents a decimal.Decimal in python). Below some of the supported operations to be used within ReportBro with examples. For more detailed information about writing python statements, please refer to https://docs.python.org/3/reference/simple_stmts.html.
Operation Description Examples
Arithmetic operation +, -, /, *, %
${NetPrice} + ${Vat}
${Minutes} % 60
Comparison operators <, >, <=, >=, ==, !=
${Price} > ${Budget}
${Tax} != 0
Logical operators and, or, not
${Weight} > 0 and ${Capacity} <= 200
${CompanyName} or ${Name}
not(${Age} >= 18 and ${AcceptTerms})
Conditional statement value if cond else other_value
'ok' if ${Weight} <= ${Capacity} else 'not enough space'

'ok and plenty of space' if ${Weight} < ${Capacity}/2
    else ('ok' if ${Weight} <= ${Capacity}
        else 'not enough space')
There are a few functions available when evaluating expressions:
Function Description Examples
len(x) Return number of elements in a list x or the length of a string x
len(${Name})
len(${InvoiceItems})
str(x) Convert x to a str (unicode in py2)
'Number of customers: ' + str(${CustomerCount})
int(x) Convert x to an int
int(${Price})
float(x) Convert x to a float
NOTE: there can be rounding issues when using float types due to the way how floats are stored internally (see Floating Point Arithmetic for further information on floats).
float(${Price}) * 1.2
decimal(x) Convert x to a decimal.Decimal
NOTE: number parameters are saved as decimals, so you cannot use floats when performing arithmetic operations with number parameters.
Always pass a string parameter to decimal function to avoid any possible rounding issues with floats. e.g. decimal('3.4') instead of decimal(3.4), the latter would result in 3.3999... instead of 3.4

${Price} * 2.5  # bad, will not work because Price is a decimal
${Price} * decimal('2.5')  # good, works because both values are decimals
randint(x) Return a random int below x
'random value between 1 and 3: ' + str(randint(3) + 1)
rand Return a random float between 0 and 1
rand() * 100.0

Keyboard Shortcuts and Helpers

By pressing a key or a combination of keys, you can trigger some known behavior and do things that normally need a mouse, trackpad or other input device.
Shortcut Description
ctrl+c (Windows, Linux)
cmd+c (Mac)
Copy the selected element to the clipboard
ctrl+v (Windows, Linux)
cmd+v (Mac)
Paste the content of the clipboard into the template
ctrl+z (Windows, Linux)
cmd+z (Mac)
Undo the previous command and also undo multiple commands. This can also be done via the button in the menu bar.
ctrl+y (Windows, Linux)
cmd+y (Mac)
Redo, reversing the undo command. You may also redo multiple commands. This can also be done via the button in the menu bar.
esc Close a popup window shown for selecting parameters, patterns or to enter test data for lists. Content provided within a popup window is always saved.
backspace Delete the selected element. This can also be done via the button next to the element in the menu panel.
cursor up, cursor down, cursor left, cursor right Move the selected element pixel by pixel. You may also enter the exact position of the element in the detail panel.
drag element+ctrl Move the selected element pixel by pixel (instead of 5 pixel steps when dragging an element with mouse or touchpad).