Columnar report is used to create a horizontally aligned report with little difficulty. Let's take a look at an example:
Employee Information Employee ID 1 2 3 4 First Name Laurena Jonathan Jerenny Jennifer Last Name Croft Hopkins Miner Lee Position Sale Representative Sale Representative Marketing Vice President Hire Date 09/12/1984 04/03/1987 05/19/1979 06/09/1981 Home Phone ( 301) 823-7424 ( 301) 946-2349 (410) 349-2834 (703) 223-4422
To do such a report, follow the steps below:
- Assuming that you have connected your database as in Lesson 1, start JReport and select HBlank icon under the New tab on the Open Report dialog. Click on the Create button.
- The following window will appear.
Assuming you have completed Lesson 2, perform the following steps for each tab to create a columnar report.
Data: Select the Employee table under the Tables node and place it in the working set.
Conditions: Select QBE, then under the Employee_Employee ID column, type < 5.- So far, you can click the Finish button to generate the report. You will find that all the sections are also aligned horizontally as below:
- Select Label from the Insert menu, and place the label into the ReportHeader section. Double click the label to edit it. Type "Employee Information". Then modify the font of the label and resize the label to fully display the text of label.
- Click the Insert DBField button on the Edit toolbar to access the Insert DBfield dialog box, and select the fields Employ_Employee ID, First Name, Last Name, Position, Hire Date, Home Phone (use Ctrl key to select multiple fields), check the Vertical radio button, then click the Insert button to insert them into the Detail section.
![]()
- After refining the layout, your report may look like this:
![]()
- Select the Report Header section and open Report Inspector, set the property Underlay to be true. This will align the title Employee Information with the data.
- So far, you can view your report as below.
Currently, the horizontal report has the following limitations:
- All the fields or objects cannot cross pages. That is to say, you cannot set the section property CanCrossPage = true. And you cannot insert an object, such as a Crosstab object, which will cross pages into your report. In these cases, sometimes the result has a problem (not completed).
- In order to support a mailing label report, there is a property named TileDetailSection for detail section, however, it cannot work in this type of report. So you cannot set this property to be true.
- Some properties of fields, such as AutoFit, WordWrap, do not work.
- You can insert other normal reports into this type of report if they do not cross pages. Otherwise, the subreport contents will be cut off.