The Kexi Handbook

Martin A. Ellis and Jaroslaw Staniek

The Kexi Handbook

2

Contents
1 2 Introduction Kexi Basics 2.1 Kexi Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Creating a New Database File . . . . . . . . . . . . . . . . . . . 2.3 The Kexi Main Window . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Main application elements . . . . . . . . . . . . . . . . . 2.3.1.1 2.3.1.2 2.3.1.3 2.4 2.4.1 Project Navigator pane . . . . . . . . . . . . . . Database object windows . . . . . . . . . . . . . Property Editor pane . . . . . . . . . . . . . . . 1 2 2 2 3 3 3 4 4 5 5 6 6 6 6 8 8 8 9 10 12 12 12

Opening an existing Kexi database file . . . . . . . . . . . . . . Opening a database file in the Open Existing Project dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . on . . . . . .

2.5 3

2.4.1.1 Notes . . . . . . . . . . . . . . . . . . . . . . 2.4.2 Opening an existing Kexi database file by clicking .kexi file’s icon . . . . . . . . . . . . . . . . . . . . . . 2.4.2.1 Notes . . . . . . . . . . . . . . . . . . . . . . Using built-in help . . . . . . . . . . . . . . . . . . . . . . . .

Building Simple Databases 3.1 3.2 3.3 3.4 3.5 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Designing Database Tables . . . . . . . . . . . . . . . . . . . . . . 3.2.1 The Table Designer window . . . . . . . . . . . . . . . . . Entering Data Into Tables . . . . . . . . . . . . . . . . . . . . . . Designing Database Queries . . . . . . . . . . . . . . . . . . . . . Designing Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 Most important terms . . . . . . . . . . . . . . . . . . . .

The Kexi Handbook

3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.8 3.5.9

Forms versus tables . . . . . . . . . . . . . . . . . . . . . Working with form design . . . . . . . . . . . . . . . . . . Using the Widgets tab . . . . . . . . . . . . . . . . . . . . Inserting widgets - text fields . . . . . . . . . . . . . . . . Assigning data sources . . . . . . . . . . . . . . . . . . . . Inserting text labels . . . . . . . . . . . . . . . . . . . . . . Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.8.1 Assigning actions to form buttons . . . . . . . . Widget layouts . . . . . . . . . . . . . . . . . . . . . . . . 3.5.9.1 3.5.9.2 3.5.9.3 Springs in widget layouts . . . . . . . . . . . . . Removing widget layouts . . . . . . . . . . . . Size policies for widgets within a layout . . . . 3.5.9.3.1 Values of size policies . . . . . . . . . .

13 14 15 15 16 17 17 18 19 19 20 20 21 21 21 23 24 25 25 25 26 26 26 27 28 28 29 29 30 30 31 31 31 32 32

3.5.9.3.2 Vertical and horizontal stretch . . . . . 3.5.10 Setting widgets size and position by hand . . . . . . . . . 3.5.11 Setting the tab order . . . . . . . . . . . . . . . . . . . . . 3.6 4 Entering Data Using Forms . . . . . . . . . . . . . . . . . . . . .

Configuring Kexi 4.1 Window Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 IDEAl mode . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.2 Childframe mode . . . . . . . . . . . . . . . . . . . . . . Docking and Undocking Windows . . . . . . . . . . . . . . . . 4.2.1 4.2.2 Docking and undocking side panels . . . . . . . . . . . Docking and undocking child windows . . . . . . . . .

4.2

5

Command Reference 5.1 The File Menu . . . 5.2 The Edit Menu . . . 5.3 The View Menu . . 5.4 The Insert Menu . . 5.5 The Format Menu . 5.6 The Data Menu . . 5.7 The Tools Menu . . 5.8 The Window Menu 5.9 The Settings Menu

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

5.10 The Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

The Kexi Handbook

6

Credits and License

33 34 34 35 35 36 36 37 38 38 39 39 39 40 40 40 41 41 43 43

A Introduction to Databases A.1 What Is a Database? . . . . . . . . . . . . . . . . . . . . . . . . . . A.2 Database and Spreadsheet . . . . . . . . . . . . . . . . . . . . . . A.2.1 How Is a Database Different From a Spreadsheet? . . . . A.2.1.1 A.2.1.2 A.2.1.3 A.2.1.4 A.2.1.5 A.2.1.6 A.2.1.7 A.2.1.8 Referential data integrity . . . . . . . . . . . . . Data redundancy . . . . . . . . . . . . . . . . . Data integrity and validity . . . . . . . . . . . . Limiting data view . . . . . . . . . . . . . . . . Performance and capacity . . . . . . . . . . . . Data entry . . . . . . . . . . . . . . . . . . . . . Reports . . . . . . . . . . . . . . . . . . . . . . . Programming . . . . . . . . . . . . . . . . . . .

A.2.1.9 Multiuse . . . . . . . . . . . . . . . . . . . . . . A.2.1.10 Security . . . . . . . . . . . . . . . . . . . . . . . A.3 Database Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.4 Who Needs a Database? . . . . . . . . . . . . . . . . . . . . . . . A.5 Database Creation Software . . . . . . . . . . . . . . . . . . . . . B Comparing Kexi to other database applications B.1 Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

. . . . . . . . 44 6 . . . . . . . . . . . . .The Kexi Handbook List of Tables B. . .2 Comparison of data types used in Kexi and other database applications . . . . . . . . . .

.Abstract Kexi is the application for creating databases and for data management in the KOffice productivity suite.

The following database servers are supported by Kexi: • MySQL (See http://www.kexi-project.org/kexi/ . Kexi is part of the KOffice productivity suite for the K Desktop Environment.The Kexi Handbook Chapter 1 Introduction Kexi is a database management application.org/about. In addition to storing your Kexi databases in files. queries and forms .kexi-project. If you have any questions about Kexi.html 1 .org/support. there are two mailing lists you can use. Further information on how to subscribe to these lists.koffice. and also allows more than one person to use the database at one time. Forms can be created to provide a custom interface to your data. The Kexi development mailing list can be used to ask questions about the development of Kexi.are stored in the database. It can be used for creating databases. making it easy to share data and design. performing queries. All database objects .com/ ) • PostgreSQL (See http://www. and processing data. inserting data.org/ ) More information about Kexi can be found at the Kexi page on the KOffice website at http://www.postgresql.html. and on the website for Kexi itself at http://www. together with a few other ways of making contact with Kexi developers.tables. can be found at: • http://www. Kexi can also store your data on a database server.mysql. Using a database server allows you to share your database with other people. The Kexi user mailing list can be used to ask questions about using Kexi or about the Kexi project.

(Ctrl+N). which is why we refer to them as database files. Choose Blank Database and click the OK to confirm the creation of the project.org or Microsoft Excel create files which are called documents. The term Kexi project. Enter a name for your project. and click Next. or simply project is also used to refer to a Kexi database.kexi. Kexi creates files too. or if it is already running. and not simply as databases. regardless of whether it is stored in a file or on a database server.1 Kexi Databases Many applications such as OpenOffice.. or simple database files here.The Kexi Handbook Chapter 2 Kexi Basics 2. 2 . Run Kexi. Kexi database files usually have the extension . Use the file browser to choose a folder where you would like to save your database file. 4. use File → New. Kexi can also use databases on database servers. Select New Project Stored in File and proceed with Next. In addition to storing your databases in database files. but we refer to them as Kexi database files.2 Creating a New Database File 1.. 3. 5. 6. 2. 2. Click Create. You may change the file name in the Location: box if you dislike the one that is suggested.

Database objects (tables. For IDEAl user interface mode it contains switchable tabs with windows that are always maximized. . • Opened database objects area a central area of the application taking most of the screen space. form’s widgets) it can have several tabs. The pane contains a list of all objects created within the 3 .1. 2.3 The Kexi Main Window The Project Navigator and Properties Editor are shown in panes on each side of the child window. • Project Navigator’s pane contains a list of any object (tables. For certain objects (e.) created within the currently opened database project.g. it is available as a number of buttons. A pane can be hidden by clicking the small cross at the top of the pane (just below the toolbar).The Kexi Handbook 2. For IDEAl user interface mode.1 Project Navigator pane The Project Navigator pane is one of the most frequently used elements of the Kexi main window.. • Toolbar contains most frequently used commands. etc..1 Main application elements M AIN ELEMENTS OF K EXI APPLICATION ’ S WINDOW ARE : • Menubar contains available commands for the application. queries. For Childframe user interface mode. For Childframe user interface mode it contains floating windows. forms.3. queries. • Properties pane contains a list of properties of currently activated database object. behaving just like your operating system’s taskbar. These can be resized or hidden as required.) listed in the Project Navigator can opened by clicking (or double-clicking. depending upon your global KDE settings) on their names. The navigator also contains small toolbar with most usable commands related to the database objects. it is available as a number of tabs. • Taskbar contains a list of currently opened windows with database objects.3. 2. You will find detailed description of any of the commands in the appendix.

forms. minimize and undock the window.3. Depending on the context. There’s a small icon on the left side of the title bar which can be clicked to show a context menu with commands related to the window. Click the first one on the right hand to close the window. The first.The Kexi Handbook currently opened Kexi database project. Design selected object. If the object’s window was already opened. Place the mouse pointer on the icon on the tab. For each object on the list a context menu is available using the right mouse button.1. Click it to close the tab. The objects are split into groups: tables. In this case it is enough to single click on the object name to open its window. and Delete selected object.3 Property Editor pane In the Property Editor pane you can change properties of the object displayed in the active window. • Window buttons for Childframe user interface mode The other buttons (from right to left) can be used to: maximize. always visible tab. queries.2 Database object windows O PENING AN OBJECT ’ S WINDOW 1. the action just activates the window without switching it’s view mode.1. Double clicking with the left mouse button on the object’s name on the list allows to open the object in Data View. 2. Note that your operating system or window manager can be set up to handle single clicks instead of double clicks. contains the list of available properties. C OMMANDS RELATED TO OBJECT WINDOWS • Closing an object window When the IDEAl user interface mode (the default) is used. you can select Window → Close from the Menubar. Create a new object.3. each window has its own tab. A Close button will become visible. this is context menu for the persons table. Select the object in the Project Navigator pane. Alternatively. R ULES FOR USING THE P ROPERTY E DITOR : 4 . Click the Open button on the Project Navigator pane’s toolbar. Properties. regardless of the user interface mode you are using. the pane is consisted of one or more tabs. 2. 2. In the Childframe on the right hand of each opened window there are buttons you can use to control the window. The Project Navigator pane also contains a small toolbar for most frequently used commands (from left to right): Open selected object. For example.

Yes (true) means that the button is toggled on. Choose Open Existing Project tab. 2. By clicking it you can revert the value of the property to the original value that was loaded from the database upon opening the database object.The Kexi Handbook • Each row contains a single property. it is usually the case when it is opened in Data View instead of Design View 2. >No (false) means that the button is toggled off. • After changing the value of a property.kexi file icon.4 Opening an existing Kexi database file T O OPEN AN EXISTING K EXI DATABASE FILE : • select it in the Open Existing Project dialog. You should see the Choose Project startup dialog. • You can use the mouse or the keyboard to change values of particular properties. You will see the following dialog: 5 . or • the active database object’s window does not offer properties. – text – drop down list of values – Yes/No. you can enter the value directly or increase or decrease its value by clicking with the left mouse button on the arrows.4. a special Undo changes button appears on the right side of the Property Editor’s list. you can toggle the value by clicking on the button. T HE P ROPERTY E DITOR PANE IS EMPTY IF : • no single database object’s window is opened. The button is only visible when the property is actually highlighted.1 Opening a database file in the Open Existing Project dialog • Run Kexi. or • open it by clicking on the . • There is no need to confirm a changed value: changes are visible immediately after moving to a different row of the Property Editor’s list or by pressing the Enter key. • Names of the recently changed properties that not yet were stored in the database are marked with bold text. • M OST FREQUENTLY USED TYPES OF PROPERTY VALUES ARE : – a number.

2. Kexi will display appropriate dialogs.mdb file. a web or FTP server or a MS Windows network share).kexi file’s icon Click file’s icon using your file manager or desktop. • If you have selected a file of an external type.The Kexi Handbook • From Current location drop down box.2 Opening an existing Kexi database file by clicking on .4.1. pick a folder containing a file you are looking for. you can change the selection of the Filter: drop down list to All Files to display all available files (regardless of an extension).kexis extension). Kexi will provide you with the option to import the file.IN HELP IN K EXI ARE AVAILABLE : 6 . like a MS Access .kexic extension) or a shortcut to a project on database server file (with .5 Using built-in help T HE FOLLOWING WAYS TO GET BUILT.1 Notes Note about database files accessed remotely.g.4. In case the file you are looking for has an other extension. 2. then open the file and copy it back to the remote source if you want to make it up to date. You may want to open a database file that is located on a remote source (e.2. but this is not the case with database files. Kexi will open this database project automatically. a copy of the file will be downloaded to a temporary directory on your computer and all your changes will be made to this local file. By clicking on a database file located on a remote source. • You can either pick a file or enter its name in the Location: box. 2. The remote original of the file will remain unchanged.1 Notes • By default the Filter: drop down list has Kexi Database File-Based Project selected. • Click OK.4. • If you have selected a connection data file (with . 2. K Desktop Environment allows you to open files from remote sources directly in applications and to save changes back to the source. so it’s recommended to copy (download) the file to your computer first.

• What’s This? hints. Select Help → What’s This?from the menu bar and click on an area of the application to get hints about it. 7 . The Handbook is available by pressing F1 key or selecting Help → Kexi Handbook from the menubar.The Kexi Handbook • The Handbook in form of electronic document.

2 Designing Database Tables First. 2. Read Section 3. Read Section 3. 3. you could build a simple database utilizing most elementary Kexi’s features.5. Enter data into tables. Design database tables. 3. Design database queries. A layout for Persons can be found in section Data integrity and validity in that chapter. 8 . Read Section 3.. 4.4.1 Introduction To learn the basics of Kexi. from the Menubar. Select Insert → Table. Use forms to enter data. advanced database design topics will not be covered here. 5.6. You can also use the button Create object: table on the Project Navigator’s toolbar. These are exactly the same tables as described in chapter Database and spreadsheet. there will be two tables added to your database: persons and phone_numbers. perform the following steps: 1.. To make things simpler.The Kexi Handbook Chapter 3 Building Simple Databases 3. Read Section 3.2.3. 1. Design forms. Read Section 3. Start by creating a new empty Phone Book. Having a new empty database project.

1. these cannot be empty. ENTER THE FOLLOWING FIELDS INTO THE TABLE DE SIGN : 9 . For example.1 The Table Designer window TABLE D ESIGNER WINDOW CONSISTS OF FOLLOWING COLUMNS : • PK .you can enter here any information useful for understanding what the given field is provided for. • Comments . In the Table designer window. • It does not matter whether you are using small or capital letters. • Field name is a word used by the database. numbers and underscore sign "_". It will be displayed for users of the database application. because of the same reason. • Data Type . This additional text will be saved within the table design and only visible in design mode. The name must only contain roman letters. Moreover. I N A SIMILAR WAY. You can recognize you are in design mode because the Switch to design view button is toggled on within the main Kexi toolbar.Primary Key. on the other hand. never with a number. Ü) or space characters. Use the latter instead of spaces or dashes. • Field Caption . ¶. For Kexi the database name "Persons" is the same as "persons". allows you to enter any letters and special characters. Looking at the top of designer’s window you will notice that Kexi proposed you a generic name like template for the new table. 3. 2. usually not visible for users of the database application. The Table Designer’s window will appear.caption of the field which will be displayed during data entering. In the first row click on the cell in the Field Caption column and enter Name as field caption. a database user will not able to enter letter characters into this field. every row corresponds to a single table field. N OTES ABOUT FIELD NAMES AND CAPTIONS • Every table field must have a name and a caption. The name may not contain special (national) characters (like ±. the table name is not yet visible in the Project Navigator. allowing to set a main rule for entered data for a given field.2. The table design is not saved yet so you will be able to assign more proper name later. • Field names must be started with a letter or underscore sign "_". when an integer number data type is set for a field.a combo box containing a list of data types. • Field caption.The Kexi Handbook 2.

Note that filling the Caption field automatically fills the Name field. click on a cell in the Data Type column. in a similar way as persons table. To do this. the Save Object As dialog window appears. and in this chapter you will learn how to do this fast and effectively. Change house_number field’s type to integer number. All the above fields. Create a person field of type Integer number and phone of type Text. This allows you entering data into the table. As for your previous table. Its name appears in the Project Navigator pane. For your convenience the rule for using only letters.The Kexi Handbook • • • • surname street house_number city 3. You can enter some. numbers and the "_" character is kept. Unlike the name.g. 3. Click Switch to data view button on the toolbar to finish designing and switch to Data View for the table. Kexi offers a generic name like Table1. You can alter the contents of the Name field if you want to. 10 . Create the phone_numbers table. 8. 7. e. 10. You need to specify the name for the new table. are of type text. To change the name. The list of data types will appear. Select the Integer number type. as a form.3 Entering Data Into Tables You have designed the two tables Persons and phone_numbers. You are asked about an agreement for automatic adding of primary key to the table. None of them contain any data yet. the caption can contain any characters including spaces and special characters. Do not use a number type here because phone numbers can have many different forms and prefixes. 4. Persons table design is ready. From now on. The Persons table has been created and opened in Data View. Click Switch to data view button on the toolbar and enter Phones caption for the table. As the design is not yet saved in the database. 6. the house_number field only accepts numbers. except house_number. allow Kexi to automatically create a primary key. enter Persons into the Caption field and press the Enter key or click the OK button. The Caption field will be used to display the table to database end-users. Click Add primary key button to continue. 9. 5. house_number row and then click on drop down list’s button (you can also press F4 or Alt+Down.

is marked on the left hand with an arrow symbol. However. marked with blue (autonumber) text in the last row. • Instead of pressing the Esc key. you can click the Cancel toolbar button or select Data → Cancel Row Changes from the menubar. you can also click with the mouse in a cell to select it. Inserting new rows and entering data for them in Kexi is different from the way of doing this in spreadsheets. Open it in Data View using the Project Navigator’s context menu. You can navigate through table cells using the arrow keys. the cursor is placed in the id column. The current cell is marked with (usually black) thicker border. Page Down. 11 . the current row is being edited. • Click the Shift+Enter keys to accept changes made to all cells in the currently edited row. Initially. To enter data for a new row. after opening the table Persons. It means you do not have to enter values there by hand when entering data for a new row because the cell will be filled automatically with successive numbers. i. The contents of the cell. You can also click OK toolbar button or select Data → Save Row from the menubar. The column has autonumber property defined. to move your cursor to the special empty last row marked with a plus sign. In the persons column you need to provide a number of the person existing in the persons table. The current row. street. Start with the persons table. End keys. Page Down. you need to use the arrow keys or mouse. Also enter surname. 2. 3. Home. if present. When done. a cell cursor. move the cell cursor to the last empty row either by using the Arrow Down key or by clicking in the last row with the mouse to append a new row.The Kexi Handbook 1. are highlighted with a different color. D ETAILS A BOUT ACTIONS AVAILABLE W HILE E NTERING DATA I NTO TABLES • As soon as you enter the first character. To cancel changes made to the entire edited row.e. • Pressing the Esc key when the contents of a cell is edited cancels changes made to this cell. press the Esc key again. A pencil symbol appears on the left side of the data table. • Double clicking a cell with the left mouse button or pressing Enter or the F2 key also starts editing of the current row. the pencil symbol will not disappear because you can still move to a different cell of the edited row to change its contents. Fill the phone_numbers table with data. Place your cursor in the (second) name column and enter a person’s name. the one you have placed your rectangular cursor in. house number and city.

as in the figure below. you need to learn how to tell the database what you are looking for. You can also use File → Save from the menubar or press the Ctrl+S keys. Double-click the name field in the persons table. Unlike databases written on a paper sheets. Because the query design has not been saved yet. 6. Results are returned faster even for large data sets. 3. 2.2 ). you will be asked to specify a name for it. house_number. Click the Switch to data view button on the toolbar. add surname. 3. to switch from design to viewing the data provided as query results.1 Designing Forms Most important terms 12 . however to be able to perform effective queries in your database. street. 4.4 Designing Database Queries A database’s primary purpose is to store and help extract information you are looking for. Kexi database allows you to specify more search criteria.. This will join both fields by creating a new relationship. Select the table persons in the drop down list Table: located at the top of the window and click the Add button. Create a new empty query by selecting Insert → Query.. The window is split into two areas: query relationships at the top and query columns below. With database queries you can limit data coming from a table to a predefined set of rows and columns as well as dynamically join data coming from multiple tables. All this is a power of databases. To see how queries work in practice you will create a contacts query joining data from two tables: persons and phone_numbers (designed in chapter 3. drag it and drop into the person field of the phone_numbers table. 1.5 3. The design window will appear.5.The Kexi Handbook 3. from the menubar. Do the same for the phone_numbers table to insert it too. city fields from the persons table and phone from the phone_numbers table. to add the field as a query column. In a similar way. 5. Save the query design for later use by clicking the Save button on the toolbar. Enter Contacts text in the caption field and click the OK button. A graphical representation of the table will appear in the relations area. Query design is now ready for testing. Add query relationship using mouse drag & drop technique: click the field id in the table persons table.1i and filled with data in chapter 3.

To do this. so they are not displaying any data from your database unless you assign a data source to them.5. e. New. container widgets can be inserted inside a container. such widgets are called in short form fields. Each widget of this type can be bound to a data source field (a table or a query column). in many cases forms are better suited for data entry: • A table can contain too many columns to display them on your screen.g. • Widgets able to perform a specified action. frame widget or tab widget are containers. Form design Tasks you are performing to define the appearance and functions of the form. 13 . insert form fields of various types and place them at the appropriate location. empty forms have no data source assigned. Within other applications this widget type is sometimes called form control because it can perform previously defined action of controlling your database application’s behavior. A form can display such a data using multiple rows. e.2 you learned about how to enter data directly into tables using their data sheet view. a text box or an image box. • Other widgets allowing to enrich a form’s appearance. • A form allows to visually split data fields into logical groups. However. Most frequently used are fields for displaying text and numbers. The form’s surface itself is a container as well. Labels with additional information can be inserted to give users more hints on how to use the form or what given data fields mean. you need to provide data source. The data source is needed because forms itself are only tools for displaying and entering data. Entering a new value or changing the existing value of such a field causes a change in the bound table or query column (after accepting the change).The Kexi Handbook Form A window provided for easy data entry and presentation on the computer screen. A command button cannot be called as container because it is not possible to insert a widget inside it. Form field Direct equivalent of a column in a table or query. thus increasing readability. For example. Form’s data source Database table or query providing data displayed in the form. a ‘line widget’ can visually separate two form areas.g. while tables and queries are the source of data. In more complex cases. 3. Container widget A widget that can contain other widgets within its area. e. Therefore. Main widget types are: • Widgets displaying information.g. so nesting is possible. a push button that can close the current form. Form widget Form’s element.2 Forms versus tables In chapter 5.

The list simplifies widgets lookup by name and navigation between them. 1. Form designing is performed in Design View. adjusting widget’s size.5. you can resize the form by moving the borders. Optionally. There is information about currently selected widget’s name and type displayed on the first and second tab.g.3 Working with form design As with table or query design. select Insert → Form from the Menubar. A new frame will appear. 3. As with table design.5.The Kexi Handbook • Command buttons can be used within forms for commonly used commands so users can use forms in a similar way as a standalone applications they know. 2. More about these commands can be found in Section 5. 14 . The form is covered with a grid which simplifies accurate positioning of the widgets. the pane has three tabs related to the currently selected form: The Properties tab Contains a list of properties for the currently selected widget. The Widgets tab Contains a hierarchy of all widgets of the form. Form Designer provides Property pane. • In data sheet view displaying multi-row data text fields or images is as easy as within forms. To save some space on the screen. grouping). Formatting commands are also available in the Format menu. The Data source tab Contains properties related specifically to the data source of the currently selected widget or the form itself. you are able to use Data View and Design View. Additional toolbars are also available: • The Widgets toolbar used for inserting new widgets into the form • The Format toolbar used to format form’s elements (e. you can use New Form command from drop-down button on the Project Navigator’s toolbar or Create Object: Form command from the context menu. We will often refer to the form design window as to Form Designer. To create a new empty form.

3.5. 1. you need to place appropriate fields on it. A new text box widget will be placed in the point where you clicked.4 Using the Widgets tab The Widgets tab in the Property pane provides a list of form widgets and their hierarchy. You can resize the widget afterwards by dragging one of the small boxes appearing near its corners.5 Inserting widgets . and then switch to the Properties tab to change the widget’s properties. Click Text Box button on the Widgets toolbar. To do this. use the buttons on the Widgets toolbar. N OTE • Changing the current selection on the list causes appropriate selection on the designed form. Keeping the Shift key pressed allows to select entire lists of widgets. move the inserted widget using drag & drop to a desired position. The type has also an icon displayed . it is possible to select a widget by name.the same as the one displayed on the toolbar used while form designing is performed. 3. Click on the form surface with the left mouse button. Each widget is presented within the hierarchy beside other widgets being on the same level (the same parent container). 2. • Keeping the Ctrl key pressed while an item on the widgets list is being selected allows to select multiple widgets at a time. Users will only see a widget text. For example. 15 . Each widget has displayed its name and type.5. i. Child widgets (inside containers) are presented using indented names.The Kexi Handbook 3. If you select another widget or the form surface. Before you release you can drag your mouse to specify a desired size for the widget. the boxes disappear.e.text fields Let’s create a form providing information about persons. provided by Text property or similar. Note that the boxes are only visible when the widget is selected. Giving widgets reasonable names can be useful but is not mandatory. Each button corresponds to a single widget type. If needed. a form connected it with Persons table. This allows for easier widget lookup by name and easier navigation. Note that widget’s name is a property that is not visible to the user of your form. If the form being designed should present data obtained from the database.

Some of the commands are only available for certain types of widgets. as you will alter its properties. In the Data Source tab of the property pane enter field name name in the Widget’s data source drop down list. Paste. Now you need to do specify widget’s data source. • The commands Cut. Click the first text field widget at the top of the form.e. Delete and other. a place the displayed data will be fetched from. so these are not able to display information from the database. Keyboard shortcuts are also available for these commands. use the Data Source tab of the Property pane. After the Ctrl key is released. Click on the form’s surface. 1. activated by a right mouse button click the desired widget or the form’s surface. Repeat this action once again until you get three text boxes inserted in your form. To assign data source. Switch to the Data Source tab and enter persons table name in the Form’s data source drop down list. you will use table persons as a data source for your new form. 2. For sake of simplicity we will limit ourselves to three data fields.The Kexi Handbook 4. • Holding the Ctrl key down while clicking a widget allows to select multiple widgets. you can select this name from the drop down list. the dragged widget will not be moved but copied in the new location.6 Assigning data sources The fields you inserted have no data source assigned yet. 16 . even between separate database projects. Alternatively. to duplicate a widget within the same form you can hold down the Ctrl key while moving the widget. 1.5. As mentioned above. 2. You have assigned form’s data source. The menu offers commands like Cut. more complex. Alternatively. Copy. • Instead of using Copy and Paste commands. Many of the commands are also provided in the Menubar. usually Edit. The very first step is to specify the form’s data source. N OTE • There is a context menu available in form’s design mode. i. you can select this name from the drop down list. 3. Click the Text Box toolbar button again and click on the form surface to insert another widget. Copy and Paste makes it possible to move or copy widgets between forms.

available for the user to execute. Persons. Enlarge this label’s size and and increase the font size using Format → Font.5. N OTE • If you want to remove widget’s data source assignment for a form widget.8 Actions An Action is a single activity isolated in the application. menu command. You can now save the form’s design (this is not mandatory to test the form in action). house_number and city text fields in a similar way. on the top of the form insert another label displaying name of the form. 3. you should see form’s fields filled with data from the persons table.g. i.e. a text cursor appears at the location where you can enter the desired title. Click on next text field widget and enter surname as the data source. Enter consecutively: Name. after opening a form). The form’s name will be filled automatically. Enter data sources for street.. 3. Unless you made a mistake while entering data sources. Surname and Street. 4.. This is the right moment for testing your form. Additionally. • Use the Go to selected form’s data source button to select appropriate table or query in the Project Navigator. you can use Clear widget’s data source button near the Widet’s data source drop down list. placing them on the left side of the text fields (or on the right hand if your operating system uses right-to-left layout).The Kexi Handbook 3. It can also be executed automatically as a reaction for a given event (e. To save.7 Inserting text labels To make it easier for the form’s user to identify the meaning of every field widget. click the Save object changes toolbar button or use the File → Save (Ctrl+S) menu command. Insert three text label widgets onto the form. On inserting a new label. Enter Persons as caption and click the OK button.5. these should have added text labels with appropriate titles. you can use the Clear form’s data source button near the Form’s data source drop down list. Click the Switch to data view toolbar button. so you can quickly open a table or query being the data source of the form. Upon saving you will be asked for entering the form’s name. 17 . Similarly. To create text labels the Label widget is used.

Delete Row). but only if you have a widget selected in the Design view. 18 . if you assigned Delete Row action. Select the existing button widget by clicking on it or put a new button widget onto the form. An Assigning Action to Command Button dialog window will appear presenting a list of available actions. enter its title and press Enter key. 3. Select one of the actions on the list (e. If you inserted a new button.The Kexi Handbook 3. If you make changes to the font settings the changes are applied to the text of that selected widget. From the context menu select Assign action.. command. 2. To assign action: 1.. Switch to form’s Design view if you have not done yet. The assigned action is executed after button is clicked.1 Assigning actions to form buttons Many actions can be assigned to form button.5. Click the OK button or press the Enter key to accept your selection. Available application-wide actions will be listed. • Actions only work in the form’s data view. action is available in data view. For example. 4.g. Click the button widget with the right mouse button to display the context menu. After switching to the form’s data view you can try whether the action works. Not every action’s assignment is reasonable. For example.8. 8. 6. the Font. 5. From the Action type drop down list select Application item. clicking the button.. the current database row will be deleted.. One of the actions is selected if the widget already has action assigned. 7. select No type item from the Action type drop down list of the Assigning Action to Command Button dialog window. similarly to executing Edit → Delete Row (Ctrl+Delete) menu command (depending on your settings you may be asked to confirm the removal). N OTE • To remove an action assignment. Otherwise the Action type drop down list has the No type item selected.

All widgets existing within the container or within the form. 2. This line is displayed only in the form’s design view. spacing is constant. Widget layout is presented in the design view using a blue. Besides the grid type. Select spring icon on the Widgets toolbar. a layout for the form itself. i. springs can use edges of the form as a boundary for expanding. • Select two or more widgets that should be placed in a common layout. being on the same level will be put into a single common layout. 19 . To make springs work you need to create a global widget layout. where widgets are inserted and select one of the layout types from the context menu item Layout Widgets .The Kexi Handbook 3. Then. In fact the situation is even worse because you cannot assume a given form requires a given space because users have different font sizes and display resolutions. there are other widget layout types. Moreover.9.5. vertical Vertical widget layout horizontal Horizontal widget layout 3. green or red box drawn with a broken line. Text fields are closer to each other. invisible element allowing to adjust widget’s position and size within layouts. and select one of the layout types from the context menu item Layout Widgets . Positioning. In each of these cases you can also use Format → Layout Widgets menu. Such a spring stretches or squeezes a widget on the right. • Click a container widget (or a form surface itself).9 Widget layouts In most cases form widgets should be conveniently arranged and aligned. aligning and resizing widgets by hand is not easy and these parameters are not adjusted when the user resizes the form. Using special tool called widget layouts can help to automatically lay out the form widgets. its space is better used.1 Springs in widget layouts A spring in widget layouts is a special. so it can have desired size and position. Click on a selected point of the form to insert the spring. Using layout in a form improves alignment. bottom or left hand. There are two methods to create widget layout. To use a spring: 1.5. Widget layout is an action of grouping two or more widgets so these are well positioned and have appropriate sizes.e. top.

5. perform one of these actions: • Click with the right mouse button on the layout’s border and select Break Layout command from the context menu. N OTE Removing widget layout using the Break Layout command will not remove widgets contained in the layout. three buttons put into the horizontal layout will be resized to fit their visible text. For example. • Click with the left mouse button on the layout’s border and select Format → Break Layout menu command.2 Removing widget layouts To remove widget layout without removing widgets. in Kexi you can choose between various widget’s size policies. A size policy is a flexible strategy for controlling how a widget is stretched (or shrunk) depending on other neighbouring widgets and space available within the form. Horizontal Stretch defining strength of activity of the Horizontal Size Policy.9. The settings are presented as a group of properties called Size Policy. there are settings for size policy available in the Property Editor. For each widget inserted into the form. Vertical Stretch defining strength of activity of the Vertical Size Policy 20 . just select the layout by clicking on its border and press Delete key or use Edit → Delete menu command or context menu command. After putting widgets into a layout. Vertical Size Policy defining vertical size of the widget. depending on their type and size of the entire layout itself.9. If you want to remove the widgets as well. This group of properties contains: Horizontal Size Policy defining horizontal size of the widget. These widgets will be automatically resized with preferred settings.The Kexi Handbook 3. typically each widget gets a proportional (Preferred) size policy.3 Size policies for widgets within a layout Instead of setting a fixed size for your widgets. 3.5.

2 Vertical and horizontal stretch The Vertical Stretch and Horizontal Stretch properties accept integer values greater than or equal to 0. the widget can be expanded to take as much space as possible but other widgets usually will not allow for that Different widget types have various default size policies. especially if you set a stretch value greater than 0. These properties allow to fine-tune the behavior of size policies. Minimum and Maximum.5.5. button widgets have default size policy set to Minimum (in both directions). it can be expanded to take as much space as possible. The default value for the properties is 0. while text field widgets have vertical size policy set to Fixed. Minimum this value means that the original size of the widget is set as minimal allowed. This type of policy can be used to force the widget to be expanded to the whole width or height. Expanding this value means that the original size of the widget is reasonable but the widget can be also shrunk.9. Preferred this value means that the original size of the widget is the best and preferred. The Kexi form designer simplifies this task by offering the following groups of commands: 21 .1 Values of size policies The following values are available in the drop down list for Horizontal Size Policy and Vertical Size Policy properties visible in the Property Editor: Fixed this value means that the widget cannot be automatically resized.The Kexi Handbook 3. 3. but the widget will be expanded if needed. it is sufficient and there is no need for expanding the widget.3.5. the widget can be shrunk or expanded however and it will stay readable. it can be expanded as well to take as much space as possible. Ignored this value means that the original size of the widget is ignored. Minimum Expanding this value means that the original size of the widget is allowed. The most frequently used size policies are Preferred. for example.3. Maximum this value means that the original size of the widget is set as maximum allowed and can be decreased without breaking the widget’s usability and readability if other widgets need more space. you will probably want to modify the position and size of widgets so the form can look cleaner and be easier to use.10 Setting widgets size and position by hand In case when your form has no main layout set for auto-positioning and autoresizing its widgets. 3. A higher value of the stretch means that the widget will be expanded more than widgets for which a lower stretch value is set. it should maintain the constant size defined at design time (width or height).9.

e. To Right All the selected widgets’ right positions will be moved to the position of the rightmost widget’s right edge. None of the above commands resizes the widgets. To Tallest The height of the selected widgets will be altered so that each of them will have the same height as the tallest one. The widget’s position can be slightly altered. as it is not common to place one widget on top of an other (except when a container widget contains other widget inside). To Shortest The height of the selected widgets will be altered so that each of them will have the same height as the shortest one. • Aligning positions of the selected widgets. Also note that clicking a widget with a mouse button is enough to bring the widget to front. These two commands are rarely used. 22 . There are also additional commands available: Bring Widget to Front (i. The position of the widgets will not be changed. above all other widgets) and Send Widget to Back (i. To Bottom All the selected widgets’ bottom positions will be moved to the position of the bottommost widget’s bottom edge. To Widest The width of the selected widgets will be altered so that each of them will have the same height as the widest one. The position of the widgets will not be changed. The position of the widgets will not be changed. The position of the widgets will not be changed. The position of the widgets will not be changed. The toolbar’s drop down button Align Widgets Position is also available. To Fit The size of the selected widgets will be altered so each widget will be resized to its preferred size and its contents. The commands are available in the Format → Align Widgets Position submenu of the menubar and in the Align Widgets Position submenu of the context menu. To Grid The size of the selected widgets will be altered so each widget’s corner will be placed on the form’s (or other container’s) grid point. a text label’s size will be changed to fit its text. for example. The toolbar’s drop down button Adjust Widgets Size is also available. below all other widgets).e. To Top All the selected widgets’ top positions will be moved to the position of the uppermost widget’s upper edge. To Left All the selected widgets’ left positions will be moved to the position of the leftmost widget’s left edge. To Grid All the selected widgets’ top-left corners will be moved so that they are positioned in the nearest grid point. To Narrowest The width of the selected widgets will be altered so that each of them will have the same height as the narrowest one. The commands are available in the Format → Adjust Widgets Size submenu of the menubar and in the Adjust Widgets Size submenu of the context menu.The Kexi Handbook • Adjusting sizes of selected widgets.

Switch to design view of the form. menu command. it is possible to ‘press’ it using the Enter or Space key instead of a mouse button.when focused.Kexi will be handling the tab orders on its own. Focus is related to widgets displayed in the form’s data view. To change tab order. After pressing the Tab key. the second types of the widgets. Availability of the focusing methods is controlled by Focus Policy property of a given widget. The list contains only widgets having focus policy allowing to use the Tab key. The Edit Tab Order dialog will appear with settings for this form. or using the Tab key. 23 . • Click the Handle tab order automatically check box to set the automatic tab order for the form. The automatic ordering means that the top-left widget will be focused first (or the top-right if your operating system uses right-to-left layout). There are a few methods of making the widgets active (moving the focus to the widget): clicking with a mouse button. To make it easier to recognize meaning of the names and types for the user. • Click a selected widget name on the widgets list and use Move Up or Move Down buttons. The latter method is often used because of its speed and convenience for users. Click the OK button to accept the changes or Cancel button to dismiss the changes. If this option has been switched on. the next widget should be focused. An other example is a button widget . 4. i. respectively) and from the top to bottom.e.The Kexi Handbook 3. to move the widgets to a desired position. rotating the mouse wheel over the widget. The window allows you to change the tab order or set the automatic tab order. any changes made to the list of widgets by hand are not taken into account . either: • Click a selected widget name in the widgets list and drag it to a desired position (up or down) using the mouse. so the form should know about the tab order.. 2.5. 3. it is focused). Exactly one form widget can have focus at the same time. The most frequent use of focus is text entry (when a given text field is active. There is a relationship between focusing (activating) widgets using Tab key and tab order setting of a form.. Execute Edit → Edit Tab Order. To alter tab order for a form’s widget: 1. The window contains a list with two columns: the first column displays widget names. icons related to the types are also displayed. and the order comes from the left to right (from the right to left.11 Setting the tab order A widget’s focus determines that widget’s activity available using keyboard.

While editing. You can move between fields using the left mouse button or the Tab and Shift+Tab keys. The designer of the database should check the form in terms of valid data entry.6 Entering Data Using Forms Data entering and editing is usually the task of the user of the database application. After entering the row’s (record) data you can press the Shift+Enter keys or click the OK toolbar button to accept changes made to the current row. and see whether the form works as expected. there will be a pencil icon visible near the record navigator.The Kexi Handbook 3. Clicking the Cancel toolbar button discards changes made to the current row and restores the contents of the data fields. A single database row (record) of data will be displayed and a text cursor will be set inside the first data field. switch to its data view. To test your form. 24 . All the navigator’s functions are also available in a similar way as in the data table view . You can use the record navigator’s button to move to a new row.

a single child window is shown maximized within the Kexi main window at once.The Kexi Handbook Chapter 4 Configuring Kexi This chapter describes how you can configure Kexi to suit your own needs and preferences. containing one tab for each child window.1.1 Window Layout Kexi provides a Multiple Document Interface (MDI). Note that changing the MDI mode requires Kexi to be restarted before the new mode takes effect. forms and scripts) open at the same time and in the same Kexi main window. There is a choice of two MDI modes available.1 IDEAl mode IDEAl mode is the default MDI mode. 4. A tab bar. You can change the MDI mode from the MDI Mode sub-menu under the Window menu. This means that you can have several database objects (such as tables. and may be familiar from other KDE applications. In this mode. The two modes are: • IDEAl Mode. Each database object is shown in a child window within the main window. and • Childframe Mode. allows other child windows to be viewed by simply clicking on the relevant tab. 4. These modes are described in the following two sections. queries. 25 . allowing a choice of how child windows are managed and displayed.

In order to use Childframe mode. The left-most button detaches. it is also possible to undock child windows. • large tables. The buttons behave as follows: the right-most button closes the child window. queries or forms. you need to select Window. but need not be maximized within it.1 Docking and undocking side panels The Project Navigator and Properties Editor side panels may be undocked by either: • double-clicking on the ’grip’ bar at the top of the panel. 4. above the Properties editor if it is open.2. a child window showing a database table could be undocked. the Project Navigator and Properties Editor panels are displayed as part of the main Kexi window.note this causes the buttons to move to the top right of the main window. see the next section. it is possible to dock the panel so it appears back in the main window again.The Kexi Handbook 4.2 Childframe mode In Childframe mode. They can also be moved and resized within the main window in the normal way (for example. allowing it to be moved out of the main window. so that it is displayed in a separate window. child windows are displayed in the main Kexi window. Once undocked. Childframe Mode from the menu. panel windows may be docked into the main window again similarly to undocking: 26 . or • clicking once on the arrow at the top of the panel. 4. For example. the child window.1. or undocks. It can be useful to undock a window when using: • a small screen. In Childframe mode. It is possible to undock each panel. MDI Mode. allowing the child window showing the table to be maximized on the screen. they can be moved by clicking and dragging the title bar). next to the cross. For more information on docking and undocking windows. The button on its left maximizes the child window . Each child window has a title bar with buttons for maximizing. The next button to the left toggles the child window between minimized and restored.2 Docking and Undocking Windows By default. Once undocked. and/or • more than one monitor. minimizing and closing it.

clicking the arrow to the right of the menu bar (next to the minimize. To dock a child window. In Childframe mode. 4.The Kexi Handbook • double-clicking on the ’grip’ bar at the top of the window. and select Dock. or • clicking once on the arrow at the top of the panel. maximize and close buttons for that child window). or • if the child window is not maximized.2. 27 . • if the child window is maximized. and selecting Undock. restore and close buttons for that child window).2 Docking and undocking child windows Child windows may be docked and undocked in Childframe mode only. on the tab corresponding to the window to be undocked. or • right-clicking on the title bar of the child window. clicking the arrow in the top right corner of the child window (next to the minimize. right-clicking in the tab bar. on the tab corresponding to the window to be docked. and selecting Undock. child windows may be undocked by: • right-clicking in the tab bar. next to the cross.

. This option can be seen after clicking on the Options» button. (Ctrl+N) Create a new project. (Ctrl+P) Print data from the active (opened) table or query. File → Download Example Databases. Currently opened project is not affected. This is currently not available for MS Windows. File → Import → Table Data From File. Show print preview for the active (opened) table or query.. (Ctrl+O) Open an existing project. File → Open.. File → Print.. File → Save (Ctrl+S) Saves object changes from the active window.... File → Export → Table or Query Data to File. Imports table data from a file in Comma Separated Value (CSV) format.. I MPORTANT Note for KDE: Make sure the proper print system is selected in the ‘Print system currently used:’ section..The Kexi Handbook Chapter 5 Command Reference Anne-Marie Mahfouf and Jarosław Staniek 5... Open the KNewStuff dialog which allows you to download example databases via the Internet. Export data from the active table or query data to a file in Comma Separated Value (CSV) format... 28 . File → Print Preview. Currently opened project is not affected..1 The File Menu File → New.

. Edit → Paste (Ctrl+V) Copy of the clipboard contents at the insertion point.3 The View Menu View → Data View (F6) Data View. If this action is used in the Form Designer.2 The Edit Menu Edit → Undo (Ctrl+Z) Undoes an action. Change. 5. You can revert to the state that existed before your last change. Edit → Copy (Ctrl+C) Copy currently selected text onto the clipboard. This will restore the change you originally made. Edit → Select All (Ctrl+A) Select all characters in the edited text box or all widgets in the Form Designer. they will be inserted onto the form. If this action is used in the Form Designer. Reverse the action of Undo. This command is unavailable if there is no text currently selected. Edit → Delete Row (Ctrl+Delete) Delete currently selected row from a table. 29 . Page Size & Margins and Add table borders.... Edit → Copy Special → Table or Query As Data Table. 5. currently selected widget or group of widgets are removed and put on the clipboard. This command is unavailable if the clipboard is empty. Paste clipboard data to a new table within the current project. Copy selected table or query data to clipboard.. Edit → Delete Delete the currently selected object. Set Font. This command is unavailable if there is no text currently selected.. currently selected widget or group of widgets are copied onto the clipboard. for the Page title:. If this action is used in the Form Designer and the clipboard contains copied widgets. File → Close Project Close the currently opened project but leave Kexi running... Edit → Redo (Ctrl+Shift+Z) Undoes an undo. View → Design View (F7) Switch to Design View.. File → Quit (Ctrl+Q) Quit Kexi.. Edit → Cut (Ctrl+X) Remove currently selected text and put it on the clipboard.The Kexi Handbook File → Page Setup. Edit → Paste Special → As Data Table.

Insert → Script. Format → Layout Widgets Creates a new layout for widgets.. View → Main Area (Alt+2) Go to the main area.. Widgets can be layed out Horizontally. View → Project Navigator (Alt+1) Go to Project Navigator pane. Format → Align Widgets Position Align the currently selected widgets’ position: To Left.4 The Insert Menu Insert → Table. empty form design without saving it. 5.5 The Format Menu Format → Font. The command is available only if scripting is enabled in Kexi. when moving widgets on the form surface the top left corner of the widget will snap or move to the nearest grid point. In Grid.. Inserts a new... Inserts a new. Format → Snap to Grid If this is enabled. View → Property Editor (Alt+3) Go to the Property Editor pane. 30 . The Script Editor window will appear. Insert → Query. empty query design without saving it. The Table Designer window will appear. Change font for selected object. The Form Designer window will appear. empty table design without saving it. Can be used in the Form Designer to set widget’s font. Inserts a new... Inserts a new. Insert → Form. Horizontally in Splitter.The Kexi Handbook View → Text View (F8) Switch to Text View.. only available for database queries and means switching to the SQL View of the Query Designer. To Bottom. 5.. To Grid. To Right.. empty script design without saving it. Format → Break Layout Breaks the currently selected layout. View → Show/Hide Project Navigator Display or hide the Project Navigator pane. Vertically in Splitter. This does reduce your freedom to freely position widgets on the form surface. Currently. Vertically. View → Show/Hide Properties Display or hide the Property Editor pane. however it also helps to line up widgets precisely. To Top. The Query Designer window will appear.

. To Grid. Data from selected column is used for sorting. unistall or download scripts.. 5. Data → Cancel Row Changes Cancel changes made to currently selected table row. load...7 The Tools Menu Tools → Import Database. Tools → Scripts Executes an already loaded script. Data from selected column is used for sorting. The last items in this menu show the currently opened window names. 31 . Opens the Data Base Importing Wizard to import an existing database into a Kexi database. unload. Window → Previous Window (Alt+Left) Switch to the previous window. Data → Sort → Ascending Sorts data in ascending order (from A to Z and from 0 to 9). Displays the file dialog to open an existing script file. To Widest. Window → Next Window (Alt+Right) Switch to the next window.8 The Window Menu Window → Close (Ctrl+W) Close the active window. Window → MDI Mode → IDEAl Mode Switch to IDEAl user interface mode.The Kexi Handbook Format → Align Widgets Size Align the currently selected widgets’ size: To Fit. Window → Close All Close all opened windows. Tools → Scripts Manager.. Format → Bring Widget to Front Bring the currently selected widgets to front.. To Narrowest. To Tallest. Format → Send Widget to Back Send the currently selected widgets to back. To Shortest.6 The Data Menu Data → Save Row (Shift+Return) Save currently selected table row’s data. Window → MDI Mode → Childframe Mode Switch to Childframe user interface mode. 5. 5. install. Displays Kexi’s Scripts Manager dialog to execute. Tools → Execute Script File. Data → Sort → Descending Sorts data in descending (from Z to A and from 9 to 0).

Help → About KDE This displays the KDE version and other basic information.9 The Settings Menu Settings → Toolbars Show or hide one of the toolbars. See the section on configuring shortcuts for more details. (this document). Settings → Configure Shortcuts. Help → Report Bug. Opens a dialog where you can edit the Primary language and Fallback language for this application. Clicking on items within Kexi will open a help window (if one exists for the particular item) explaining the item’s function.The Kexi Handbook 5..10 The Help Menu Help → Kexi Handbook (F1) Invokes the KDE Help system starting at the Kexi help pages. 5.. Help → Switch Application Language. Help → About Kexi This will display version and author information. Configure the keyboard shortcuts used by Kexi... Opens the Bug report dialog where you can report a bug or request a ‘wishlist’ feature. 32 .. Help → What’s This? (Shift+F1) Changes the mouse cursor to a combination arrow and question mark..

at Documentation by Martin A.org • OpenOffice Polska.net • Sebastian Sauer mail@dipe. Ellis martin.ellis@kdemail.pl • Lucijan Busch lucijan@kde.pasteur@free.org with contributions from Anne-Marie Mahfouf.se • Joseph Wenninger jowenn@kde. Jaroslaw Staniek staniek@kde.org • Cedric Pasteur cedric.ellis@kdemail. This program is licensed under the terms of the GNU Lesser General Public License.net. Michal Kubicki and Aron Stansvik.org • Till Busch till@bux.de • Peter Simonsson psn@linux.org • Seth Kurzenberg seth@cql. This documentation is licensed under the terms of the GNU Free Documentation License.fsnet.org • Christian Nitschkowski segfault_ii@web.The Kexi Handbook Chapter 6 Credits and License Kexi Copyright 2002-2006 The Kexi Team K EXI D EVELOPERS : • Jaroslaw Staniek staniek@kde.fr • Adam Pigg adam@piggz.com.co. LLC info@openoffice.com • Laurent Montel montel@kde. Raphael Langerhorst. 33 .uk • Martin Ellis martin.

The Kexi Handbook Appendix A Introduction to Databases A. 699 23 43 12 711 19 77 21 34 . It appears that such a card can constitute a single row in a table: Contacts table Name Joan Adam Tel No. Look at this diagram for one of the above examples: a simple phone book. The above picture shows a set of two contacts each of which is presented on a separate card. make changes or add new items. It is organised in a way allowing to easily browse the information.1 What Is a Database? You can define a database as a collection of data on one topic.

As you will see. To sum up. To make it simpler we assume the following: 35 . Add more telephone numbers (office. Moreover. each row in the table consists of columns often also called fields. A. Furthermore.1 How Is a Database Different From a Spreadsheet? Gradually exceeding the capacity of a mobile phone. Many people consider these two equivalent.2 Database and Spreadsheet It is very likely that you have already used spreadsheet applications like KSpread.org Calc or Microsoft Excel. home) for each person and add surnames to names. In the table Contacts there are two columns (fields): Name and Tel No. OpenOffice. you will probably wonder: since both spreadsheets and databases have tables.2. The collection is normally called a table. If so. for real databases we usually need more than one table. why should I use the latter? While comparing spreadsheets and databases you may encounter the following issues which you will later see in greater detail: • Referential data integrity • Data redundancy • Data integrity and validity • Limiting data view • Performance and capacity • Convenient data entry • Reports • Programming • Multiuse • Security A. you have already got a simple database with one table Contacts.. the most natural name for the table is one describing the data it offers/stores which is Contacts. expand your table Contacts adding a column (field) Address. For simple uses a single table can make up a database.The Kexi Handbook Terms and definitions: A single data which constitutes a part of a greater collection can be called a row or more professionally a record.

Joan takes three rows. You have a small problem: you often have to change the address in many rows. hence your data loses integrity.the address assigned to this person will be ambiguous. thus requiring more computer resources (larger size of data and slower access). This is typical of a spreadsheets’ ineffective way of storing data because the database grows unnecessarily. In fields Name and surname and Address the same data is entered many times. A real problem will arise if you forget to change one of the rows . London Such a table can be made both in a spreadsheet and in a database.1. What problems do we encounter at this stage? A. of course.2 Data redundancy This is directly connected to the previous problem. How can you solve these problems with a database? You can split information into smaller chunks by creating an additional table Persons with only two columns: Name and surname and Address: Persons table 36 . Western Gate 1 Frogs Drive 5. A. Moreover there is no simple way of deleting a chosen person from the table since you have to remember about deleting all rows related to him or her. there could be hundreds and thousands of them in a real database) • there are no two persons with the same name and surname Contacts table Name and surname Joan Smith Adam Willson Joan Smith Smith Joan ADAM Willson Tel 699 23 43 12 711 19 77 21 110 98 98 00 312 43 42 22 231 83 02 04 Address Western Gate 1.1.2.1 Referential data integrity Suppose you are using a spreadsheet and you need to change the address of at least one person. Using a spreadsheet is very easy. Warsaw London.The Kexi Handbook • the table is limited to two people (obviously.2. Frogs Drive 5 Western Gate 1 Warsaw. For example.

A modified table looks something like this: Persons table House number 1 5 required field Name Joan Adam Conditions required field Surname Smith Willson required field Street Western Gate Frogs Drive required field City Warsaw London required field 37 . e. The above problem shows that e.g. Adam and ADAM) and many more ways of entering the same address. London Each row in the table Persons corresponds to a single person. sometimes even negligent. People entering data can be fallible.The Kexi Handbook Name and surname Joan Smith Adam Willson Address Western Gate 1.1. Moreover You will also not find all the telephone numbers searching for the value "Joan Smith" in the field Name and surname. you must always enter house number. Dividing data in the field Name and surname into two separate fields: Name and Surname. when searching the telephone number of a person whose address is "Western Gate 1. 3. How can you solve these problems using a database? You can do this by changing the design of the table Persons by: 1. House number and City. Warsaw Frogs Drive 5. Dividing data in the field Address into three separate fields: Street. A.2.3 Data integrity and validity Note the way data is entered in the fields Name and surname and Address. because "Smith Joan" will not fit to "Joan Smith". You will get only one row instead of three. In our sample data we have both different sequence of entering name and surname (Joan Smith and Smith Joan. Guaranteeing data correctness: by ensuring that no fields are empty. Warsaw" you will not get a full result. 2. Table Contacts is from now on a relation to the table Persons . Surely you can think of many other ways.g.

even copying data may become troublesome with time. Their low efficiency is first of all due to lack of indexes accelerating the process of data search (databases do offer them). A very practical way of limiting is the following extended version of the previously described table Persons: Persons table House number 1 5 Name Joan Adam Surname Smith Willson Street Western Gate Frogs Drive City Warsaw London Income 2300 1900 Let’s assume that the newly introduced column Income contains confidential data. You may of course filter and sort rows in spreadsheets. forms and reports. In database world such a query is often known as a view. The query could select all columns except for the column Income. however you must be extra careful while doing so. A. Such "manual" editing may cause data loss or incorrect calculations.5 Performance and capacity Your computer is probably quite fast.1. A. How can you share e. Spreadsheet users are in risk of forgetting that their data view has been filtered what can lead to mistakes.1. e. you can copy and paste it to another spreadsheet and after editing paste the changed data back to the main spreadsheet.2.2.The Kexi Handbook Thanks to introducing the condition required field we can be sure that the entered data is complete. large spreadsheets. contact details of the persons with your coworkers but without revealing their income? It is possible if you share only a query and not the whole table. In case of other tables you may of course allow omitting certain fields while entering data. To limit the data view database applications offer queries. to send it for others to edit.g.4 Limiting data view A spreadsheet displays all rows and columns of the table which is bothersome in case of very large data sheets. Moreover if you use things like system clipboard. For example. 38 . while calculating sums you may think you have 100 rows of data while in fact there are 20 rows more hidden. however you will easily see that it doesn’t help with slow.g. If you want to work on a small subset of data.

39 .2. however calculations come down to modifying the spreadsheet’s fields and simple data copying. outside of graphical interfaces. A spreadsheet loads lots of data to the computer’s memory while opening.7 Reports Databases enable grouping. Most of the data loaded are probably useless/unnecessary for you at the moment. Spreadsheets are usually printed in a form of small tables without fully automatic control over page divisions and the layout of fields. Together with Limiting data view described in the previous paragraph these qualities constitute the advantage of databases. you can view the same data in many views with different orders.1.1. This means that unlike spreadsheets. Newer spreadsheets have this capability too.8 Programming Applications for creating databases often contain full programming languages. • The same goes for columns (fields) of the table.2.2. databases do not care about: • The sequence of rows since you can order the rows according to your needs. regardless of the relevance and integrity rules mentioned in previous paragraphs. Such forms are most useful if your data cannot be conveniently displayed in tabular view. A.1. A. Moreover. A.6 Data entry The latest editions of applications for creating spreadsheets enable you to design data-entry forms.g. if the text occupies too many rows or if all the columns do not fit on the screen.The Kexi Handbook Spreadsheets containing large data sets may take ages to open. Databases are capable of working in background. Data processing within a spreadsheet is usually done via a graphical user’s interface which may slow down the data processing speed. In most cases you will not have to worry how the database stores its data. e. Fields for data entry are placed loosely within the spreadsheet and very often are not secure against the user’s (intentional or accidental) intervention. Databases unlike spreadsheets load data from computer storage only when needed. In this case the very way the spreadsheet works is problematic. limiting and summing up data in a form of a report.

2. A classical way to sharing data saved in a spreadsheet with other person is to send a file as a whole (usually using e-mail) or providing a spreadsheet file in a computer network. it requires a lot of discipline. You’re accessing them using a computer network. On the other hand. For example. you will most probably save your time on everyday use. every person being able to copy the file can try to break the password.1.The Kexi Handbook A. which enables easy sharing of table data.2. This way of work is ineffective for larger groups of people . It is sometimes not so hard as the password is stored in the same file as the spreadsheet. and before you and others will start to use it.10 Security Securing a spreadsheet or its particular sections with a password is only symbolic activity.data that could be needed in a particular time may be currently locked by another person. attention and knowledge from the users. databases have been designed mainly with multiuser access in mind. Databases (except these saved in a file instead of a server) do not need to be available in a single file. To avoid such situations.3 Database Design Database design needs careful planning. 40 .2 can generate problems when the table is filled with data. forms or even selected rows and columns) which were assigned to you by setting appropriate access rights. and these cannot be guaranteed. Access rights can affect ability of data editing or only data reading.9 Multiuse It is hard to imagine a multiuse of one spreadsheet. but splitting the Address field into separate fields requires careful and tedious work. After providing a spreadsheet file in a computer network. Note that Contacts table redesign proposed in section 1. it will not be even sent to your computer. A. Even if it is technically possible in the case of the latest applications.1. rethink your database project before you create it in your computer. Even for the simplest version locking at a particular table row’s level is possible. usually by providing a user name and a password. You are gaining access only to these areas (tables. Thus. A. If any data is not available to you. Features for edit locking or copy locking of a spreadsheet (or its part) is equally easy to break. so there is no possibility of making a copy of the data in such easy way as in case of spreadsheet files. renaming a field is a simple task. by investing some time initially.

however. • You often create new spreadsheets. In the 70s scientists formed the theory of relational databases (terms like: table. A. Those were not the days of PCs. IBM System/360. • You create reports and statements for which the table view of a spreadsheet is not suitable. You can then consider switch to using a database with form views. In this case the effort of switching to databases easily pays off. Their users could (gradually) utilize many types of applications. beyond the topic of this manual. In the area of "accessible" databases with graphic user interface for PCs you can choose from the following: 41 . therefore these databases required a highly specialized personnel. Think or ask someone whether this does not lead down a blind alley. the situation hasn’t changed: they still require powerful computers or computer complexes called clusters.5 Database Creation Software So far you have learnt the general characteristics of databases without going into much detail about specific applications for designing them. This goes.g. including those for database construction. column (field) and relationality and many others). Don’t count on magical tools that would change your spreadsheet (regardless how well made) into a database. In the late 70s the first PCs were constructed. When it comes to large databases in companies.4 Who Needs a Database? S TICK TO SPREADSHEETS IF : • Your needs are limited and your data will never grow to large volumes (can you actually forecast that now?) • You are unable to acquire the methodology of database construction. • You use complicated spreadsheets and you lack time or money to switch to databases. On the basis of this theory IBM DB2 and Oracle databases were created. Although the old computers’ hardware was unreliable. one feature of databases still remains most attractive: the data access by many users through a network. e. copy within these and you feel that this work is getting more and more tedious. they were immeasurably slower and had less storage capacity. C ONSIDER USING DATABASES IF : • Your data collection expands every week. record.The Kexi Handbook A. You may however consider either outsourcing this task to someone else or using simpler tools. The first databases were built together with large mainframe computers in the 60s. which have been developed and used till today.

i. graphic user interfaces were introduced and therefore it is used for creating databases on PCs. • FoxPro . • Kexi . part of the global K Desktop Environment project. After being taken over by Microsoft. A significant contributor to Kexi’s development is the OpenOffice Poland company. Windows. especially by small companies.e.popular application similar to MS Access in simplicity.an application similar to DBase (early 90s). offered since 1985.a tool for databases operation for DOS popular in the 80s.The Kexi Handbook • DBase . This product is still offered. graphic environment for Unix/Linux systems. based on 16-Bit Architecture. 42 . developed according to OpenSource principles. Files in DBase format are still used in some specific cases due to their simplicity. Mac OS X) designed in 2003.an application for databases (data and graphic interface design) with many simplifications. • Microsoft Access . • FileMaker . where efficiency and multiuser requirements are not very demanding. This product is offered and widely used till today. though seems a bit obsolete. designed in the late 80s.a multiplatform application (Unix/Linux. therefore suitable for beginners. operating on Windows and Macintosh platforms.

the Long text type is a sub-type of the Text type. Thus. For example. this appendix shows how the terminology used in Kexi corresponds to that used by other database applications. this chapter may be useful when migrating databases from one application to another. B. To use a sub-type in Kexi. they often use different terminology. you should select the corresponding basic type (in this case. Some of the data types listed here are sub-types of other types. Text) in the table designer. For your convenience.1 Data types The table below shows how the data types in Kexi correspond to data types in other database applications.The Kexi Handbook Appendix B Comparing Kexi to other database applications Although different database applications tend to provide similar functionality. 43 . and then select the sub-type using the Subtype setting in the Properties Editor.

Time Number (Integer) dBase/FoxPro Character Memo Date Paradox Alphanumeric Memo DateTime Numeric Integer Long Integer Numeric Long Integer Single/Double precision number Float Number Table B.2: Comparison of data types used in Kexi and other database applications 44 .The Kexi Handbook Kexi Text (Text) Long text (Long text) Date/Time (Date/Time) Integer Number (Integer Number) Big Integer Number (Big Integer Number) Floating Point Number (Floating Point Number) MS Access Text Memo Date.