How to make a report with Gambas

This is now 10 years at least that report component exist. Maybe it's time for me no to document it.

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

The base concepts of a Gambas Report

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

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

The ReportVBox Container

Certainly actually the most important container of the Report family. It's the container that manage it's children vertically. If you put objects in it, it will set theire Width to its Content Width (=Container Width - Container.Padding Width - Container.Border Width) and taking care of the object margin requirement too. Then it will arrange objects vertically in function of the height required by each objects. If an object not have space to be drawed in the current Vertical space then a new page is generated with all the vBoxParents and so the draw of children can continue until the end.

If an object does not feet in an entire container space (i means only one object (like an image) it will be cutted.

The ReportHBox Container

This container arrange it's elemente horizontaly. It set the height of it's children with the same rules that the ReportVBox use. If all the elements not fit in it, the remaining part will be simply ignored.

The Objects arrangement properties

  • Property Expand : the object height will be the remaining space.

    If more than one object of the ReportVBox have its 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 relatively to the container position.

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

  • Property Margin : this property allow to the object to define a minimal distance between the object and another one.

    The most bigger value is taked into account between two objects. The margin is not fusionned with the container padding so the two value are cumulated.
    The margin can be set individualy for each border of the object.

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 define a distance between two objects. It is diferent from the margin value as it put space only between objects.

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

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