|
Page 1 of 6 2D is the big brother of 1D The Database Container (DBC) is the cornerstone of Leaflet. If, for you, the 1D (one dimension) DBC has no secrets anymore, then you’ll master the 2D’s concepts very fast. The 2D DBC is an extension of the 1D DBC. Here is a comparison of 1D and 2D : | Feature | 1D | 2D | Comments | | Zones | 3 | 9 | | Comparison of 1D and 2D structures | | 1D | | 2D | | 1 = header | | 1 | 2 | 3 | | 2 = detail | | 4 | 5 | 6 | | 3 = footer | | 7 | 8 | 9 | For what concerns 2D: Cell 5 is the detail. Cells 2, 4, 6 et 8 are headers and footers, but can also include the detail of titles (see below). Cells 1, 3, 7 and 9 contain only headers and footers. | | SQL requests behind the DBC | 1 | 1 | The 2D DBC calls all data in one single request. | | Detail criteria | 1 | 2 | 1 horizontal criteria and 1 vertical criteria | | Titles | NO | YES | See below. | | Number of DBC for a table with titles | 3 or more | 1 | Integrate everything into one single request allows to synchronize all data. | | Processing of missing records | NO | YES | | The more templates get complex, the more DBC they contain. The 2D DBC simplifies the layout of tables by integrating both dimensions (horizontal and vertical) into one single object. The introduction of the 2D DBC is a big undertaking because technically as well as conceptually the 1D became a special case of the 2D when used in one single dimension. The 2D is more powerful than 2 1Ds Thanks to the integration of both dimensions, one will be able to achieve results that are difficult or impossible to obtain with 1D : 1. Generation of empty cells When the database contains only records of cells with a value, the 2D DBC will automatically generate the empty cells. This is not possible with the 1D. 2. Non display of empty columns (lines) Titles without cell data or cells without titles can be ignored on request. With 1D, visibilities and sophisticated calculated fields have to used in order to obtain a similar result. 3. Automatic cell spanning 2D is capable of comparing cell contents in all directions. In the case of identical values, it is possible to activate cell spanning (horizontal or vertical). Leaflet will then center the cell contents instead of repeating it. This is not possible with 1D. 4. Optimal column width balancing With 2D Leaflet is able to calculate in real time the optimal column width in function of the cell contents. This calculation takes not only the content of body and title cells but also all of their display properties (constraints, format, hyphenation, html text etc…) This is much more powerful than the existing 1D equal or proportional balancing. The optimization aims to obtain the table with the smallest height for a given total width (or inversely the narrowest table for a given total height). This is not possible with 1D. Currently it is often made use of an external program to estimate the width of the columns and write it down in a database table. This approach is not integrated and is unable to take all parameters into account (like hyphenation, tracking, html text etc…) Easier table design with the “title” object
Next to the combination of the 2 dimensions, the 2D DBC accepts a specific graphic object, the “title”. One (or more) title(s) can be drawn in the 2 and 8 areas (for horizontal titles) or 4 and 6 (for vertical titles). These titles behave like 1D DBC with automatic synchronization of the title cells with body cells (area 5). Each title will be automatically aligned with corresponding title and body cells. It is also possible to combine several titles in one area. Titles take account of the other objects drawn in the same area according to the conventional Leaflet extender rules. |