The ad hoc layout is the basis for any report created with Ad Hoc Reporting. It defines the elements, which can be modified by the user, their formatting and the design elements of a report. Layouts may as well use static elements and fields which are fixed in quantity and / or appearance.
The types of elements which are present in an ad hoc layout defines which pages will be available on the GUI to modify these elements. For instance, if there is at least one group in a layout, the group page will be available for this layout.
This chapter describes how set up an ad hoc layout using the i-net Designer.
There are two types of ad hoc layouts available:
The condition for an i-net Clear Reports report to be an real ad hoc layout is the usage of the LayoutDatasource. This data source will be created by the installation process. It does not refer to any database. Instead it provides template fields which will be replaced by real database fields at the time the ad hoc report is executed.
So to create a basic layout, simply start the i-net Designer, create a blank report and set the LayoutDatasource as it's only data source.
Please note: if there is any other data source than the LayoutDatasource, the report will be regarded as ready report.
To create a table style layout, at least one field has to be added to the details section of the layout. These fields will later on be replaced by the fields chosen by the user. The value type of the LayoutDatasource field added to the details section is irrelevant.
There are three types of column layouts available, depending on the page layout and the number of fields added to the details section.
To allow a variable number of fields per table row in an ad hoc report, add exactly one field to the details section of the layout. This field will be copied at runtime for any field the user adds to his ad hoc report.
The distance between this field and the left border of the details section will be the left gap of all columns of the resulting ad hoc report.
If you add a vertical line to the right of the column, the distance between the right edge of the field and this line will be the right gap of all columns of the resulting ad hoc report.
Any other design element like a horizontal line or a box will not be copied or modified. It will appear in the resulting report at the designed position.
If a user now adds for instance three fields to his ad hoc report, the rendering result will have three columns, each one with the designed gaps and separator lines between them.
As you can see, the width of the field itself is scaled to fill up the remaining space between the gaps. So the width of the designed field is not relevant for the result, but there is a minimum width for all types of fields.
To use the automatic column name, place a text field with exactly the name of the data field in the section above the detail area. This is what the i-net Designer will do automatically by the way. This field will be replaced by the name of the column at runtime. In our example the bold text field with the content 'column_integer' is replaced with the column names 'ProductName', 'Price' and 'Size'.
If you add more than one field to the details section of a report, the ad hoc report uses fixed columns.
Fixed column layouts do not scale or copy fields horizontally. Instead the layout will be used as is.
If the user selects less fields than defined by the layout, the remaining columns will be left empty. If the user selects more fields than defined by the layout, the details section will be copied vertically to place all columns.
Please note that the header is not copied. So if the user selects more columns than defined by the layout, the table header and the cell contents wont be consistent anymore.
The mailing label mode is used if the page layout is set to multi-column or label. In that case the available space for the layout is limited in width and height.
Mailing label allows fixed and variable columns as well, but the fields will be placed by another algorithm at runtime.
Please note that there is no automatic column name for mailing labels.
If there are to many columns to fit into the height of the label, the label will be divided horizontally as well to create several columns and rows.
Any field that overflows the height of the mailing label will be invisible.
Grouping will be available to the user, if an ad hoc report contains at least one group. In case of a real layout the user can add or remove groups, in case of a ready report the user will only be able to change the defined groups.
If groups are added to an ad hoc report, first of all the existing groups of the ad hoc layout will be filled. So if you've designed three groups and the users adds three groups the result will display the three designed groups and their layout.
If the users adds more groups than available in the ad hoc layout, the last group header and footer will be copied including it's summary fields and name elements.
If a group defined by the ad hoc layout is not filled by the user, it's contents will be moved into the next group header and footer.
If there is no group filled at all, the content of the designed group will be moved into the page header and page footer depending on whether the group has set the flag 'Repeat group header in each page'.
This feature can be used to create grouped chart reports by placing the chart in the group footer of the first group. If there is no group at all, the chart will be moved into the page header and display all datasets.
Please note: Summary fields and group name fields are not moved since they are bound to a certain group. They will be removed if their group was not set/filled by the user. As a further notice, charts and cross-tab of the group footer will be moved into the page header, since they cannot be placed in the page footer.
To enable the usage of sums for the user, simply put a sum field into any section except the 'Detail Area'. The settings of this sum field will have no effect since they are overwritten by the user's choices.
At runtime the sum fields will be automatically aligned to the columns they sum up. They'll keep their size and vertical offset as well as the formatting.
The section a sum field is placed into defines the grouping and running total type of this field.
Placing a sum field in several sections will cause Ad Hoc Reporting to add similar sum to all of sections but with different group and running total types.
As an example, placing a sum in the group and report footer will create a grouped sum and a total for all columns selected by the user.
Adding several sum fields to the same section in a real layout will have no effect. Ad Hoc Reporting will only use the first sum field in a section as a template.
In a final report, sum fields can only be modified by the user. Their position, number and appearance is fixed.
The formatting of a field in an rendered report depends on three sources (in ascending priority):
Property formulas are allowed in both the ad hoc layout and ad hoc dataviews. But keep in mind, that the type of the field at runtime may be different to the type of field used in the ad hoc layout. So, if you use 'currentFieldValue' in a property formula, the formula is only valid if the types match otherwise it will have no effect.
Ad hoc reporting supports to modify one chart and crosstab per ad hoc layout. If there are more charts or crosstabs in an ad hoc layout, they will not be modified. In a ready report the surplus charts / crosstabs will be rendered as they were designed. In a real layout they will be invisible since insufficiently configured charts and crosstabs are not displayed.
Every feature of charts and crosstabs can be used except the combined chart.
Every special field can be added to and ad hoc layout. The content of the following fields can be modified by the user:
The following fields can be disabled by the user if present in the ad hoc layout:
Please note, that special fields, which require information about the total number of pages of the rendered report will cause the whole report to be rendered before the first page is displayed. If these fields are not present the renderer will display the first page of a rendered report to the user as soon as it is available.
So, using special fields like 'Page number' may decrease the user experience of your ad hoc layout.