II - First steps
         
          21 - Basics
            To illustrate this chapter of examples, we will use the data base demo provided with DELPHI (alias DBDEMOS).

            You must create a new application with a named principal card Form1.
             

          22 - Simple Report
            Put on Form1 the following components:
            • TTable:
              • Table1.DataBaseName:=DBDEMOS
              • Table1.TableName     :=ANIMALS.DBF
              • Table1.Active             :=TRUE
            • TDataSource
              • DataSource1.DataSet:=Table1
            • TFrDBDataSet
              • frDbDataSet.DataSource:=DataSource1
            • TFrReport
            • TFrDesigner
            • 2 TButton
              • Button1.Caption:=' Editing'
              • Button2.Caption:=' Preview'
            What gives us:
             
          23 - Variables
           
            FastReport makes it possible to associate names of variables with fields of data or values system. That makes it possible to prevent the end-user deciphers the generally reduced field names. In our example, we will make try to create a variable on fields " BMP " and " NAME " of  Table1.

            You can define the variables with the property "Values " of frReport1 or with a right click on this same component then " Variables editor "
             


              click on Variable editor

             
            Now, click on the button " Variables... " to define the left part of this window (our variables)
             
            Write sentences as it is show on the previous figure : "Demo variables " represents the category (grouping of variables) and "xxxxx field. " the variables, to make the difference between the two, the variables start with a space (?)
            Then cliquez on Ok to have this:
               
            The category is set in the left combobox and the variables below. Now, each variable must be associated to a field.
            For that, select the variable here then the field (, the variable " name field " is associated with field " NAME " of  Table1.




        Page preceding                          Next Page                     Contents