Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
How To Change the Tab Order of GUI Controls
How To Contribute
How to Create and Open a ".gmail.txt" Archive
How to deal with Git and Gitlab concerning your Project
How to deal with Git and Gitlab for Gambas
How To Deal With Subversion for Gambas
How To Display a Chinese Character
How To Draw with gb.Cairo
How To Enter Data With gb.db.form
How To Get Gambas Web Started (1)
How To Get Started
How To Interface Gambas With External Libraries
How To make a chart with the gb.chart component
How to make a report with Gambas
Begins...
How To Make KDE Run Gambas Executables Automatically
How To Open, Debug & Compile The IDE
How To Open a MySQL connection and use it
How To Open a SQLite connection and use it
How To Open a Unix ODBC connection and use it
How To Package Gambas
How To Package your Project
How To Print
How to Run Gambas and Gambas Apps on Windows using WSL
How To Run Gambas On Windows using Cygwin
How To Translate A Gambas Project
How To Translate Gambas
How To Translate The Gambas IDE (deprecated)
How To Use Parallel Port
Language Index
Language Overviews
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

How to make a report with Gambas

It is now 10 years at least that report component has existed. Maybe it's time for me to document it!

First of all if someone can deal with my spelling faults and grammar errors, I'll give him a big hug.

The base concepts of a Gambas Report

I've written Gambas report component to be able to cope with a maximum of the users needs. But it is definitively not like the common report generators.

It is not based on section design (Even if gb.reports has section named things, it does not have the same goal), but on Container/Object design, named boxed design for web page. So it follows the different constraints given by the Containers (parents) and the objects (children) to draw the page and define when generating a new page.

The ReportVBox Container

Most certainly the most important container of the Report family. It's the container that manages it's children vertically. If you put objects in it, it will set their Width to it's Content Width (=Container Width - Container.Padding Width - Container.Border Width) and take care of the object margin requirement too. Then it will arrange objects vertically in accordance to the height required by each of the objects. If an object does not have space to be drawn in the current Vertical space then a new page is generated with all the vBoxParents and so the drawing of children can continue until the end.

If an object does not fit in an entire container space (i mean only one object, like an image) it will be cropped.

The ReportHBox Container

This container arranges it's elements horizontally. It sets the height of it's children with the same rules as the ReportVBox. If all the elements do not fit inside, the remaining parts will be simply ignored.

The Objects arrangement properties

  • Property Expand : the objects height will be the remaining space.
    If more than one object of the ReportVBox has it's Expand option activated then the Object height will be the remaining space divided by the number of objects on the current page.

  • Property Ignore : this object is not arranged by the container and its Left and Top properties are used to place it relative to the container position.

  • Property Fixed : this object will be repeated each time it's container is repeated.

  • Property Margin : this property allows the object to define a minimal distance between the object and another one.
    The biggest value is taken into account between two objects. The margin is not fused with the container padding so the two values are accumulated.
    The margins can be set individually for each border of the objects.

The Containers arrangement properties

  • Property Arrangement : this property is currently present only on the panel container.

    You can define 4 different values: None, Fill, Vertical, Horizontal. Vertical and Horizontal act respectively like ReportVBox and ReportHBox.

  • Property Spacing : this property creates a distance between objects. It is different from the margin value as it puts spaces only between objects.

  • Property ForceNewPage : it's a quite special feature. Each time this container is repeated it forces a new page.

  • Property OnePiece : the content of this container must be shown on one page. All will be done to achieve this goal.