Tutorial - Lesson 3

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


Now we are ready to define the DETAIL band for this sample report. To recap, the DETAIL band performs the data retrieval from the database and inserts it in the desired location in your report. Sometimes it is a good idea to draw the sample report on a piece of paper to help you "visualize" how the report needs to look when it is generated. If you are creating report(s) for other people you definitely need to discuss with them how their report should look like, and what information it needs to extract from the database file(s).


If you haven't familiarized yourself with FRAMES you need to - review that section of this manual.


Right now the work area inside the Report Formatter is completely blank, with only the top menu and toolbar buttons visible. Click on the BAND main menu option, then select NEW, then select DETAIL from the options. Notice that the screen now has a rectangular box with red boxes at each corner and the top/bottom middle. A ruler bar is displayed to the left of the rectangular box also. The red rectangles allow you to resize the size of this report band - we'll leave it alone for now.


Now we need to add some database fields to the DETAIL band. Database fields will be placed inside of FRAMES - a FRAME tells the Report Builder engine how and what to print in the location where the FRAME is located. There are two ways of adding a FRAME to the DETAIL band - you can select from the main menu "Frame", then "Create" - an empty FRAME is automatically created inside the DETAIL band at the top left of the DETAIL band. An easier way is to place the mouse in the area where you want to print the database field, then right click the mouse to display a pop up menu; select the menu option titled "New Frame", and an empty frame will be created in the exact location where the mouse was at inside the DETAIL band.


You can choose to move the empty frame to a better location right now, or wait until you define the information that will be inside the frame. To move the frame with the mouse you left click anywhere inside the frame, and while holding down the left mouse button you drag the rectangle to the desired location. You can also use the keyboard to move the frame by holding down the CTRL key, and use the arrow keys to move the frame. Here is what the screen looks like for now:



Report Formatter Detail band


To add text to a frame you left click the mouse twice inside the CONTENTS entry field in the FRAME properties box and type the text in the Contents field. If the length of the text is longer than the frame you can easily resize the frame by clicking on the right middle red box, and while holding down the left mouse button drag the box to it's new size. You will notice that the mouse cursor will change shape from an arrow to a double arrow, which is telling you that you can resize the FRAME in the directions of the arrow by left click-dragging the mouse.


For now we are just adding the fields to the DETAIL band; left click the button with the flashlight inside it to display the dictionary.  When the dictionary appears on screen click the tree expand box directly underneath the 'Processed Files' description. A list of all database fields is displayed on screen for you to choose from:



Respondent fields available


To select a field simply double left click on the field name description; for this example the Name field will be used.  Scroll down (near the bottom of the fields), and double left click on Name (Res:Name). The dictionary window will disappear, and the FRAME box is now updated:



Properties for Name frame


Notice that an equal sign (=) is displayed in front of the field name (Res:Name)  Also notice that the inside of the frame itself is displaying dollar signs ($). This helps you in properly resizing the frame size for this database field. (This field is by default being displayed as a 24-character string field; that's what the @s24 means in the Picture field).


At this point the steps for adding a new frame and populating the frame are repeated for each of the remaining fields in the database. After moving the mouse to the desired location inside the DETAIL band, right click the mouse, select New Frame, then select the desired database field.  Repeat these steps to add frames for address, city, state and zip fields.  Finally, drag the frame to the right of the last added frame. All frames will be located at the top of the DETAIL band. Here is what the screen looks like:



Report detail band with fields populated


Not too pretty, huh? We need to move the frames so they are aligned at the top for a nice looking report. The Report Builder features a very easy way of aligning frames in many different ways. You can choose to move each frame yourself using the mouse, or the keyboard, but this can be very time consuming.  There is a much easier way! The first thing to do is select all the frames on an imaginary line that you want the data to be printed on. To do this you will left click the left-most frame, then, while holding down the CTRL key, you will left click on each frame located on that imaginary line. After doing this through to the last frame you will have multiple frames displaying the resize rectangles at each corner, but they will be blue in color.


With the mouse cursor over the last frame, right-click the mouse to display a pop up menu - this menu will display various options to aligning multiple frames. The easiest choice is ALIGN TOP; after selecting it from the menu all the frames are now aligned in a more pleasing way:



Detail band with 5 fields aligned


So far we have one DETAIL band, with 5 frames containing database fields.


We could save and print the report right now, but the way we have designed it, this report would print every respondent record in your database... with a lot of blank, white space above and below each record!  Let's do a couple more things first before printing.  Select all the frames again by clicking one of them, and then holding down the CTRL key and clicking on the other four.  Then, move all five of them up to the top of the Detail band at the same time.  Next, click on the detail band itself, then drag and drop the red holder at the bottom of the detail band up, until it's just under the respondent field frames.  Your formatter should now look like this:



Detail band after moving frames up and resizing


This will eliminate wasted space before and after each record prints.  Next, we're going to have you do something that's a little advanced, but necessary to prevent your entire database from printing.  Click on the File / Report Properties menu option.  Click on the flashlight to the right of the Record Filter field, and select ID (Res:RespondentIDNumber) from the list by double-clicking on it.  Then, right after this field add: < 50 Your Report Properties screen should look like this:



Adding a filter to the report


This last step is telling this report to only print respondent ID records that are less than 50.  This should then print less than a full page of records when we next run the report. Click Save on the report properties screen.


We'll save the report now by clicking the floppy disc button located on the toolbar. You can also save the report by clicking File from the main menu, then selecting Save. It is a good idea to periodically save your work as you change the report.


Now we need to test the report to see how it looks. Go ahead and click File from the main menu, then select Exit from the pull down menu in the Report Formatter. You will notice that the Reports Manager screen is now different:




Report Manager with new report added


The newly created report is displayed, with the filename / date / time / size information about this report file. To print the report click the Print button; the report will be sent either to the screen (print preview) or to the printer, depending on which you select from the filter screen. For this example we highly recommend that the report be generated to the screen.



Sample printed report


The important things to notice here is the layout of the information to detect problems. Using the report, we can see these problems:


The street address field is getting chopped off (ex: 910 1/2 West 81)


There is no sorting being done on the database. It would be nice if it were sorted by last name


One of Report Builder's most attractive features is it's flexibility - you can change anything you want on your reports. The problems identified above with the first report are very easily fixed. We will be fixing these things in the next tutorial step.


To recap; in this lesson you learned:


It's a good idea to draw a report on paper first during brainstorming sessions


How to add a DETAIL band


How to add a FRAME onto the band


How to select a database field from the dictionary that is printed from inside a FRAME


How to align multiple FRAMES with minimal effort


How to print the new report to check for printing problems