Example 1. Creating a report manually

Top  Previous  Next

In this example, we will create a report manually. For this, we will do the following:

 

press the btn4 button on the toolbar, and in the "Add New Item" window, choose "Blank report";
in the "Data" menu, choose the "Choose Report Data..." item and check the "Products" data source:

 

nowizard_1

 

switch to the "Data" service window (if it is not on the screen, it can be shown by choosing the "Data|Show Data Window" menu item). Expand the "Data Sources" item, then the "Products" item:

nowizard_2

 

drag the "ProductName" data column onto the "Data" band. FastReport creates a "Text" object, which is connected to this column and a header for it;
we will create the "UnitPrice" data column by using another method. For this, press the "Text" button on the "Objects" toolbar:

 

nowizard_3

 

leave the mouse and drag its pointer onto the "Data" band - you will see that FastReport offers to insert an object. Choose the needed position and click the mouse to insert the object;
place the mouse pointer on the object and click the small button in the right corner of the object. You will see a list of data columns. Choose the "UnitPrice" item from the list:

 

nowizard_4

 

create the "Text" object - header for the "UnitPrice" column. Place in on the "Page Header" band. Double click the object and write the text "Unit Price";
create the "Text" object - report title. Place it on the "Report Title" band and write the text "PRODUCTS";
set "Bold" as font style for all objects that are placed on the "Page Header" and "Report Title" bands. For this, select objects by pressing Shift, and press the btn20 button on the "Text" toolbar. After this, the report will be looking like this:

 

nowizard_5

 

In order to run the report, click the btn3 button on the toolbar. The report will be built and shown in the preview window:

 

nowizard_6