issue68:tutoriel_-_libreoffice
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue68:tutoriel_-_libreoffice [2012/12/31 16:15] – créée andre_domenech | issue68:tutoriel_-_libreoffice [2013/02/24 16:58] (Version actuelle) – [2] fcm_-_ekel | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ===== 1 ===== | ||
+ | ** | ||
Base Input Forms | Base Input Forms | ||
So far in our series on LibreOffice Base, we have planned the layout for our database, created the tables, and created the relationships between those tables. Now, we need to think about how we will input the data into our tables and link them all together. You can edit the tables manually in the tables section of the program, but the best way is through input forms. We will create three forms: Authors, Media, and Books. We will handle the forms for authors and media first as they are the easiest. The form for books will bring everything together in one place. | So far in our series on LibreOffice Base, we have planned the layout for our database, created the tables, and created the relationships between those tables. Now, we need to think about how we will input the data into our tables and link them all together. You can edit the tables manually in the tables section of the program, but the best way is through input forms. We will create three forms: Authors, Media, and Books. We will handle the forms for authors and media first as they are the easiest. The form for books will bring everything together in one place. | ||
+ | ** | ||
+ | Formulaires de saisie de Base | ||
+ | |||
+ | Jusqu' | ||
+ | |||
+ | ** | ||
Create the Authors and Media Forms | Create the Authors and Media Forms | ||
Ligne 20: | Ligne 28: | ||
The Media form is created in the same way, only using the Media table instead of the Author table. | The Media form is created in the same way, only using the Media table instead of the Author table. | ||
+ | ** | ||
+ | Créer les formulaires Auteurs et Médias | ||
+ | |||
+ | Cliquez sur Formulaires dans le volet Base de données sur la gauche. Vous pouvez créer des formulaires de deux manières : par le biais de l' | ||
+ | |||
+ | À la première étape de l' | ||
+ | |||
+ | La deuxième étape concerne les sous-formulaires dont nous n' | ||
+ | |||
+ | La cinquième étape nous demande une mise en page de nos champs. Comme nous n' | ||
+ | |||
+ | La sixième étape concerne l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | A la huitième étape, nous donnons un nom au formulaire, Auteurs, et choisissons si nous voulons le modifier encore ou bien l' | ||
+ | |||
+ | Le formulaire Médias est créé de la même manière, en utilisant uniquement la table Médias, et le champ Type, au lieu de la table Auteurs. | ||
+ | |||
+ | ** | ||
Create the Books Form | Create the Books Form | ||
Ligne 26: | Ligne 54: | ||
On the toolbar at the bottom of the form, select the Form Navigator. This opens a small dialog containing the elements of our form. Right-click MainForm, then New > Form. A new form is added to the list. Since it is already selected, just start typing to rename it FormAuthors. We will use this subform to create the link to our Authors table through the BooksAuthors table. Right-click the FormAuthors and select Properties. On the Data tab, select table for the Content type, and BooksAuthors for the Content. Now, click on the ellipse button next to List Master Field. A link-fields dialog pops up. This is where we create our link between the Books table and the Authors table. Under BooksAuthors, | On the toolbar at the bottom of the form, select the Form Navigator. This opens a small dialog containing the elements of our form. Right-click MainForm, then New > Form. A new form is added to the list. Since it is already selected, just start typing to rename it FormAuthors. We will use this subform to create the link to our Authors table through the BooksAuthors table. Right-click the FormAuthors and select Properties. On the Data tab, select table for the Content type, and BooksAuthors for the Content. Now, click on the ellipse button next to List Master Field. A link-fields dialog pops up. This is where we create our link between the Books table and the Authors table. Under BooksAuthors, | ||
+ | ** | ||
+ | Création du formulaire Livres | ||
+ | Malgré l' | ||
+ | |||
+ | Dans la barre d' | ||
+ | |||
+ | ===== 2 ===== | ||
+ | ** | ||
Create another subform under MainForm named FormMedia. Edit the properties, setting the Content Type to table, and the Content to BooksMedia. Click the ellipse next to List Master Field, and select BookID under both BooksMedia and Books. Click OK and close the Form Properties dialog. | Create another subform under MainForm named FormMedia. Edit the properties, setting the Content Type to table, and the Content to BooksMedia. Click the ellipse next to List Master Field, and select BookID under both BooksMedia and Books. Click OK and close the Form Properties dialog. | ||
Ligne 34: | Ligne 70: | ||
Make sure you have the FormAuthors selected in the Form Navigator. Click on the Table button in the More Controls toolbar. Underneath the two input boxes for title and published, draw the table on the page. Right-click in the header section of the new table and select Insert Column > List Box. Right-click the newly created column and select Column. This displays the List Box properties. On the General tab, change the label to Authors. Switch to the Data tab. For the Data field, select AuhtorID. This tells Base we want to relate this to the AuthorID field in the BooksAuthors table. For Type of list content, select Sql. In List Content, we will write a short SQL statement to fill our list box with the names from the Authors table. You can click on the down-arrow to give yourself a small edit box to work in. The SQL statement is: | Make sure you have the FormAuthors selected in the Form Navigator. Click on the Table button in the More Controls toolbar. Underneath the two input boxes for title and published, draw the table on the page. Right-click in the header section of the new table and select Insert Column > List Box. Right-click the newly created column and select Column. This displays the List Box properties. On the General tab, change the label to Authors. Switch to the Data tab. For the Data field, select AuhtorID. This tells Base we want to relate this to the AuthorID field in the BooksAuthors table. For Type of list content, select Sql. In List Content, we will write a short SQL statement to fill our list box with the names from the Authors table. You can click on the down-arrow to give yourself a small edit box to work in. The SQL statement is: | ||
SELECT “Name”, “AuthorID” FROM “Authors” | SELECT “Name”, “AuthorID” FROM “Authors” | ||
+ | ** | ||
+ | Créez un un autre sous-formulaire sous MainForm nommé FormMédias. Modifiez les propriétés et définissez comme Table le type de contenu et le contenu à LivresMédias. Cliquez sur le bouton avec les ... à côté de la liste Lier les champs maîtres, puis sélectionnez LivreID sous les deux LivresMédias et Livres. Cliquez sur OK et fermez la boîte de dialogue Propriétés du formulaire. | ||
+ | |||
+ | Maintenant, nous devons créer nos contrôles qui contiennent nos auteurs et des médias. Rappelez-vous, | ||
+ | |||
+ | Assurez-vous que vous avez sélectionné le formulaire FormAuteurs dans le Navigateur de formulaires. Cliquez sur le bouton Contrôle de Table de la barre d' | ||
+ | |||
+ | ** | ||
This statement will select all the records from the Authors table. Set the Bound field to 1. The Bound field selects which field will fill the list box. Since we selected the Name field first, the bound field of 1 will fill the list box with the data from the Name fields. Close the list box properties and save your work. | This statement will select all the records from the Authors table. Set the Bound field to 1. The Bound field selects which field will fill the list box. Since we selected the Name field first, the bound field of 1 will fill the list box with the data from the Name fields. Close the list box properties and save your work. | ||
Ligne 45: | Ligne 89: | ||
We are now finished with the form. Save and close it. | We are now finished with the form. Save and close it. | ||
+ | ** | ||
+ | Cette déclaration permet de sélectionner tous les enregistrements de la table Auteurs. Positionnez à 1 le champ Champ lié. Le champ Champ lié détermine quel champ remplira la zone de liste. Comme nous avons sélectionné le champ Nom d' | ||
+ | |||
+ | |||
+ | Nous allons créer le Contrôle de table des Médias de la même manière que nous avons fait pour les auteurs. Sélectionnez le formulaire FormMédias dans le Navigateur de formulaires. Dessinez le Contrôle de table à la droite de vos contrôles de titre et de publication. Créez une colonne dans le contrôle. Ouvrez les propriétés de la colonne et changez l' | ||
+ | |||
+ | SELECT “Type”, “MédiasID” FROM “Médias” | ||
+ | |||
+ | Définissez le champ Champ lié à 1. | ||
+ | |||
+ | Nous en avons maintenant terminé avec le formulaire. Enregistrez et fermez-le. | ||
+ | |||
+ | ** | ||
Using the Forms | Using the Forms | ||
Ligne 53: | Ligne 110: | ||
In the next HowTo, we will create a query and a report for extracting information from our database. | In the next HowTo, we will create a query and a report for extracting information from our database. | ||
+ | ** | ||
+ | |||
+ | Utiliser les formulaires | ||
+ | |||
+ | Les formulaires Auteurs et Médias sont simples à utiliser. Il suffit de sélectionner une ligne vide et de taper le nom ou le type. Vous devrez ajouter vos auteurs et vos types avant d' | ||
+ | |||
+ | Nous avons maintenant une méthode qui fonctionne pour entrer des données dans notre base de données. Mais même si elle fonctionne, il y a un inconvénient dans cette manière de faire. Dans le cas où vous avez besoin d'un auteur ou d'un type qui n' | ||
+ | |||
+ | Dans le prochain tutoriel, nous créerons une requête et un rapport pour extraire des informations de notre base de données. | ||
+ |
issue68/tutoriel_-_libreoffice.1356966941.txt.gz · Dernière modification : 2012/12/31 16:15 de andre_domenech