iReport 3.7 — Save 50%
Learn how to use iReport to create, design, format, and export reports
This article by Shamsuddin Ahammad, author of iReport 3.7, covers configuring report properties
If we use the Report Wizard for generating reports, some default report properties (page size, margins, and so on) are set automatically. For our software or reports, we may need to modify the default report properties at times, so that it fulfills the user (or software) requirements.
Configuring the page format
We can follow the listed steps for setting up report pages:
- Open the report List of Products.
- Go to menu Window | Report Inspector. The following window will appear on the left side of the report designer:
- Select the report List of Products, right-click on it, and choose Page Format….
- The Page format… dialog box will appear, select A4 from the Format drop-down list, and select Portrait from the Page orientation section.
- You can modify the page margins if you need to, or leave it as it is to have the default margins. For our report, you need not change the margins.
- Press OK.
You have seen that there are many preset sizes/formats for the report, such as Custom, Letter, Note, Legal, A0 to A10, B0 to B5, and so on. You will choose the appropriate one based on your requirements. We have chosen A4. If the number of columns is too high to fit in Portrait, then choose the Landscape orientation.
If you change the preset sizes, the report elements (title, column heading, fields, or other elements) will not be positioned automatically according to the new page size. You have to position each element manually. So be careful if you decide to change the page size.
We can modify the default settings of report properties in the following way:
- Right-click on List of Products and choose Properties.
- We can configure many important report properties from the Properties window.
You can see that there are many options here. You can change the Report name, Page size, Margins, Columns, and more. We have already learnt about setting up pages, so now our concern is to learn about some of the other (More…) options.
eBook Price: $23.99
Book Price: $39.99
What are the different checkboxes?
You'll see Title on a new page, Summary on a new page, Floating column footer, Ignore pagination checkboxes in the More... tab in the report Properties window.
What will happen if you check these options?
Title on a new page
If this option is checked, then the report title will be shown on a new page, that is, the report title will be shown on the first page without any data, and the report data will be shown on subsequent pages.
Summary on a new page
If the report contains a summary, generally it is shown just after the data, but if this option is checked, then the summary will be shown on a new page. Don't worry about the report summary, as you will learn about the report summary in the coming chapters.
Floating column footer
If a report has column footer, then it is generally shown at the bottom of the page. However, if this option is checked, then column footer will be shown at the bottom of the column, even if it is in the start/middle of the page.
If this option is checked, then the whole report will be shown in a single page. Your page size settings (height of the page) will not work if you check this option. Page height will depend on the report data. If data is less, then the page height will be small, but the height will be increased if data is more. This option is suitable for POS printing where the page height depends on the products the customer purchases.
When there is no data
When we execute the report, it is filled with data from the data source (database or others). But sometimes there may be no data (depending on the query). What will happen then? We may deal with this situation using the When No Data option in the More... section of the report Properties window. There are four options :
- No pages: If the report has no data, then just a dialog box will be shown with the message The document has no pages and the report viewer will not be shown.
- Blank Page: The report viewer will be shown with a blank page like the following screenshot:
- All Sections, No Detail: All sections of the report will be shown without data, that is, you will see just the report structure.
- No data Section: If no data is available, then a customized message will be shown in the report page of the report viewer. In order to do this, just checking the checkbox is not enough, you have to configure the NoData band.
In this article, we discussed report layouts.
If you have read this article you may be interested to view :
eBook Price: $23.99
Book Price: $39.99
About the Author :
Shamsuddin Ahammad is a Senior Lecturer and the Course Coordinator at Daffodil Institute of IT, Bangladesh. He has been teaching Java, Programming Methods, and Database Systems since 2002. He has experience in supervising hundreds of academic projects. Shamsuddin has a Masters degree in Management Information Systems (MIS) from Daffodil International University, Dhaka. He obtained the BSc(Hons) degree in Computing & Information Systems (CIS) of NCC Education Ltd, UK and London Metropolitan University joint programme from Daffodil Institute of IT. Before that, he completed the IDCS & IADCS of NCC Education Ltd. He is an Additional Reviewer of Conference on Quality Engineering in Software Technology (CONQUEST) organized by International Software Quality Institute (iSQI) in Germany. He is the author of book titled iReport 3.7 published from PACKT Publishing in March 2010.