I. Overview
1) Header generally means the top of a page and footer the bottom of a page. Header and footer are often used to display some additional information, including time, author, company name, etc.
2) Types of header and footer in FineReport Designer include text, image, formula and date, which can meet various requirements.
II. Steps
1. Prepare report data
1) Create a new report and a new dataset by inputting the following SQL statement: SELECT * FROM Products.
2) Drag [ProductID], [ProductName], [SupplierID] and [CategoryID] in the dataset [ds1] into the cell range A2:D2. Adjust text size in the cells and adjust cell styles.
3) Click [Pagination Preview] to view the effect.
4) In FineReport Designer, the header is set in the same way with the footer. Below is an introduction to how to set the header.
2. Set report header
Click [Template]-[Report Header]. The default is [Default Page] and the left-hand pane lists pages on which the header is to set while the right-hand pane lists header styles to be set.
3. Header styles: Text
1) In setting the styles, you can choose various ways of displaying the header, including text, formula, page number, date, time and image.
2) The header is by default located at the upper-left corner, click [Text], input finereport in [text] and then click [OK]. The [Text] icon will appear in the box below [Left Section].
3) Click on the [Text] icon, and you can choose text font, size and underline in [Style]. For details, please refer to: Cell Styles.
4) If the height is 0, no header effect will be displayed. Set the height to 10mm and you can see the [Font] header in the preview box below, which is displayed at the upper-left corner.
4. Header styles: Formula
1) Select [Center Section], click on the [Formula] icon on the top, input range(1,4) in the Value of [Formula] and then click [OK]. The [Formula] icon will appear in [Center Section] below.
2) Click on the [Formula] icon, and you can choose the font, size and underline of header text in [Style].
3) The [Preview] box below will display the display effect of the formula. The function will display text: 1,2,3,4.
5. Header styles: Page Number and Total Number of Pages
1) Select [Right Section] and click on the [Page Number] icon on the top to set [Font Styles] for [Page Number] and then click [OK]. The [Page Number] icon will appear in [Right Section] below.
2) Select [Right Section] and click [Total Number of Pages] on the top to set [Font Styles] for [Total Number of Pages] and click [OK]. The [Page Number] icon will appear in [Right Section] below.
3) You may choose font, size, underline, etc. for header text in [Font Styles].
4) The page number is by default 1 in the preview box below and [Total Number of Pages] is by default 100.
6. Header styles: Date
1) Select [Left Section] and click on the [Date] icon on the top to set [Font Styles] for [Date] and then click [OK]. The [Date] icon will appear in [Left Section] below.
2) You may set the display styles of [Date] by clicking on the [Date] icon. For details, please refer to: Cell Styles.
3) In the [Preview Box] below, the date of editing can be displayed.
4) Click [Date], you may choose [Left Shift], [Right Shift] or [Delete it] on the top of the style editing page. The three options are displayed on each style editing page. Click the [Left Shift] button to move the [Date] icon to the left of [Text]. In the [Preview Box] below, [Text] and [Date] will change their positions.
7. Header styles: Time
1) Select [Center Section] and click on the [Time] icon on the top to set [Font Styles] for [Time] and then click [OK]. The [Time] icon will appear in [Center Section] below.
2) You can set the display styles of [Date] by clicking on the [Time] icon.
3) In the [Preview Box] below, the time of setting can be displayed.
4) Click [Formula] and click the [Right Shift] button on the top of the style editing page. The [Time] icon will be moved to the right of [Formula]. In the [Preview Box] below, [Formula] and [Time] will change their positions.
8. Header styles: Image
1) Select [Page Number] and [Total Number of Pages] in [Right Section], click the [Delete It] button on the top and then click [OK]. The two header styles in [Right Section] will be deleted.
2) Click the [Image] button and click [Select Image] to select an image. After an image is selected, you can preview the image in the image preview box. Click OK and the [Image] icon will appear in [Right Section], but the image will not be displayed in the preview box below.
3) When adding a background image to the header, the width of the image must not exceed 649; otherwise, no matter how the image is displayed, it will ultimately be unfolded in a tiled manner.
4) Click the [OK] button below the header to save the settings, preview the report and view the header effect.
9. Header styles: Line Feed
1) Select [Left Section] and click the [Line Feed] button on the top. Then the [Line Feed] button will be directly added to [Left Section].
2) Select [Left Section] and click on the [Total Number of Pages] icon to set [Font Styles] for [Total Number of Pages] and then [OK]. The [Total Number of Pages] icon will be displayed on the next line of the [Font] icon.
3) In the [Preview Box] below, [Total Number of Pages] is displayed on a new line different from that of [Text] and [Date].
10. Header styles: select Background
1) You may set header background in the header style setting pane. Click on the [Background] icon on the top to select background styles for the header.
2) If you check [Print/Export Background] icon, then the background will be printed together with the report; otherwise the background will not be printed.
11. Pages that display the header: Home Page and Last Page
1) After the styles are set on the default page of the Header and Footer setting pane, the header or footer will be applied to all pages. If you just wish to set the header or footer on the home page and the last page, you may choose pages that display the header on the left.
2) Do not set any style in [Default Page]. Click [Home Page] in the left-hand pane and check [Whether to define the selected type]. Add a [Text] button to [Left Section] and input finereport in [Text].
3) Click [Last Page] in the left-hand pane and check [Whether to define the selected type]
4) Add [Total Number of Pages] to [Left Section], Click OK to save header styles and then click preview to view the report effect.
12. Pages that display the header—Odd Page and Even Page
1) If you just wish to set the header or footer on either odd or even pages, you may choose pages that display the header or footer.
2) Do not set any style in [Default Page]. Click [Odd Page] in the left-hand pane and check [Whether to define the selected type]. Add [Page Number] to [Left Section] and click OK to save page styles.
3) Click [Even Page] in the left-hand pane and check [Whether to define the selected type].
4) Add [Total Number of Pages] to [Left Section] and click OK to save header styles and then click preview to view the report effect.