Tutorial - Lesson 6

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  


This time around we are going to add a Page Header, which will print the title to our new report, and also print column header information at the top of each page. First, reopen the report in the Report Formatter screen (highlight the report, then click Change).


A Page Header is another REPORT BAND that is generated at the top of each page. The report engine keeps track of how much data can be printed on a page; when it's time for the printer to eject the page after printing as much information as it can, the Page Header is created, then printed at the top of the report. Each page of the report will have the Page Header information printed at the top of each page.


We are going to select BAND from the pull down menu, then NEW, then PAGE HEADER. A new empty band named Page Header is inserted above the DETAIL band automatically.


The first order of business is thinking of a title that you will easily understand. For this report title we'll use "First 50 Respondents". Any and all text that you add to a report is inserted into a FRAME, so we need to create a new frame inside the new Page Header frame. So, right click inside the Page Header band, select New Frame, and an empty frame appears. Most reports have a centered title, so here is an easy way of ensuring that the report title is always centered on screen:


Place the mouse on the right middle resize box on the empty frame


Resize the box until you reach the right side of the report


Make sure the gaps are the same for the left and right sides of the frame


Type the title inside the Contents field on the Frames Properties window


Click the center align button on the toolbar


Click the blue "A" for font type. Select ARIAL, BOLD, 12, then OK


That was easy wasn't it? You now have a title that will always be properly centered, and slightly larger than the rest of the report to make it stand out. You don't have to create your title like this - if you want it left or right aligned, or a different size then feel free to do so! You can also create multiple line titles if you want or need to - the choice is up to you!


Now we are going to create headers for each of the fields that are printed. To ensure they are printed at the top of each page they also need to be located in the Page Header band. Create a new frame inside the Page Header band directly above the leftmost column, then type in the header name (in this case, Name).  Add other column headers as shown below.


After adding all the frames and their header text you will want to resize their frames to be as small as possible. After doing that you need to align the frames so they are even. Hold down the CTRL key, then click on each frame with the left mouse button to select them all, then right click on one of them (with the mouse cursor still over one of the selected fields) to display the alignment pop up menu. Select Align Top. Now they are horizontally aligned with each other. Go ahead and move the entire line of selected frames until they are roughly 1/4 inch below the report title.


Looking pretty good now. However, the column headers would look better if they were BOLD and UNDERLINED, so go ahead and change each FRAME for the headers. Click on each of the frames, then click on the font tool (letter "A" icon in the toolbar). You may need to resize a frame if some of the column text is cut off.


Here is what we have so far:



Page Header with column headings


We can see from the above screen capture that the Page Header band needs to be reduced in height - otherwise the printed output will have a huge gap between the column headers and the database information printed in the DETAIL band. Go ahead and resize the Page Header band (left click-drag the center red resize box until it can't be reduced in height anymore.


Now we need to left align the column headers with the data information that is printed beneath it. An easy way is to first click the header frame, then Ctrl-Left click the field frame underneath it inside the DETAIL band. Once the two frames are selected click the right mouse button, then select "Align Left" from the pop up menu. Repeat this process for each column until they are left aligned. Remember that you can move the two selected objects in case they overlap other information by holding down the CTRL key, then tap the left or right arrow button to move the frames sideways. The final result now looks like this:




Page Header after height adjustment


Once satisfied with the results save your work (click the blue floppy disc), then print a sample report to the screen to see how it looks.



Sample report with Page Header band


Not bad! There is still room for improvement, but we are well on our way to a nice report. Remember,  Report Builder will print information the way you tell it to - you control how the reports look, so don't be afraid to experiment. Reports will never change information in your database file(s) - they are completely safe to experiment with.


To recap; in this lesson you learned:


How a Page Header is generated when a report is created


How to add a Page Header at the top of each page


How to add a report title at the top of each page


How to center a Page Header easily


How to add column headers in a Page Header band


How to horizontally and vertically align column headers