Duomenys

Savybių lango kortelėje Duomenys pažymėtam valdikliui galima priskirti duomenų šaltinį.

Jei norite tai atlikti…

Atverkite pasirinkto elemento kontekstinį meniu ir pasirinkite kortelęValdiklio savybės → Duomenys.

Atverkite Formos projektavimo mygtukų juostą, spustelėkite Valdiklio piktogramą ir atverkite kortelę Duomenys.


note

Duomenų bazė, su kuria susieta forma, nustatoma formos savybių lango kortelėje Duomenys.


Kortelėje Duomenys matomos nuostatos priklauso nuo valdiklio. Kortelėje bus rodomos tik pažymėtam valdikliui esamame kontekste tinkamos savybės.
Galimi tokie laukai:

Contents of the linked cell

Select the mode of linking a list box with a linked cell on a spreadsheet.

  1. Linked contents: Synchronize the text contents of the selected list box entry with the cell contents. Select "The selected entry".

  2. Linked selection position: The position of the single selected item in the list box is synchronized with the numerical value in the cell. Select "Position of the selected entry".

Duomenų laukas

Duomenų bazės formose valdiklius galima susieti su duomenų laukais.

Yra keletas variantų tai padaryti:

  1. Pirmas atvejis: formoje naudojama tik viena lentelė.

    Laukelyje Duomenų laukas nurodykite duomenų šaltinio lentelės lauką, kurio turinį norite matyti.

  2. Antras atvejis: Valdiklis yra įdėtinėje formoje, sukurtoje SQL užklausa.

    Laukelyje Duomenų laukas nurodykite SQL sakinio lauką, kurio turinį norite matyti.

  1. Trečias atvejis: jungtiniai langeliai.

    Jungtinių langelių atveju laukelyje Duomenų laukas nurodomas duomenų šaltinio lentelės laukas, kuriame įrašomos naudotojo įvestos arba parinktos reikšmės. Jungtinio langelio sąraše rodomos reikšmės gaunamos pagal SQL sakinį, įvedamą laukelyje Sąrašo turinys.

  2. Ketvirtas atvejis: sąrašo laukai

    Šiuo atveju duomenų šaltinio lentelėje saugomi ne patys duomenys, kurie rodomi ekrane, o lentelė, susieta su duomenų šaltinio lentele bendru lauku.

    Jei norite, kad sąrašo lauke būtų rodomi duomenys iš lentelės, susietos su veikiamojo duomenų šaltinio lentele, laukelyje Duomenų laukas nurodykite duomenų šaltinio lentelės, su kuria yra susietas sąrašo lauko turinys, lauką. Taip pat galima nurodyti duomenų bazės lauką, kuriuo perteikiami formoje rodomi duomenys. Tokiu duomenų lauku nurodomas saitas į kitą lentelę, jei abi lenteles galima susieti bendru duomenų lauku. Dažniausiai tai būna duomenų laukas, kuriame įrašyti unikalūs identifikavimo numeriai. Duomenų laukas, kurio turinys bus rodomas formoje, aprašomas SQL sakiniu laukelyje Sąrašo turinys.

Aprašant sąrašo laukus galima naudoti nuorodas. Jas galima sukurti susiejant lenteles SQL sakiniais (ketvirtasis atvejis) arba kuriant reikšmių sąrašus:

Nuorodos per susietas lenteles (SQL sakiniai)

Jei norite, kad sąrašo lauke būtų rodomi duomenys iš duomenų bazės lauko, bendru duomenų lauku susieto su lentele, kuriai kuriama forma, laukelyje Duomenų laukas nurodykite formos lentelės susietąjį lauką.

Saitas sukuriamas SQL „select“ sakiniu, kurį, jei laukelyje Sąrašo turinio tipas pasirinkote reikšmę SQL arba SQL [vietinė], reikia įvesti laukelyje Sąrašo turinys. Pavyzdžiui, jei lentelė „Užsakymai“ susieta su formos valdikliu, o duomenų bazėje lentelė „Klientai“ susieta su lentele „Užsakymai“, galima naudoti tokį SQL sakinį:

SELECT KlientoVardas, KlientoNr FROM Klientai.

Čia „KlientoVardas“ yra duomenų laukas iš susietos lentelės „Klientai“, o „KlientoNr“ yra lentelės „Klientai“ laukas, susietas su formos lentelės „Užsakymai“ lauku, kuris nurodomas laukelyje Duomenų laukas.

Nuorodos naudojant reikšmių sąrašus

Sąrašo laukuose galima naudoti reikšmių sąrašus. Reikšmių sąrašai – tai sąrašai, kuriais aprašomos nuorodos reikšmės. Tokiu būdu formos valdiklyje atvaizduojamas ne duomenų bazės lauko turinys, o reikšmių sąraše priskirtos reikšmės.

Jei naudosite reikšmių sąrašo nuorodos reikšmes, formoje bus rodomas ne duomenų lauko, nurodyto laukelyje Duomenų laukas, turinys, o įrašams priskirtos reikšmės. Jei kortelės Duomenys laukelyje Sąrašo turinio tipas pasirinksite reikšmę Reikšmių sąrašas, o savybių lango kortelės Bendrosios laukelyje Sąrašo įrašai matomiems sąrašo įrašams priskirsite nuorodos reikšmes, tuomet nuorodos reikšmės bus lyginamos su nurodyto duomenų lauko turiniu. Jei nuorodos reikšmė sutaps su duomenų lauko turiniu, tuomet jai priskirtas sąrašo įrašas bus rodomas formoje.

Empty string is NULL

Defines how an empty string input should be handled. If set to "Yes", an input string of length zero will be treated as a value NULL. If set to "No", any input will be treated as-is without any conversion.

An empty string is a string of length zero (""). Normally, a value NULL is not the same as an empty string. In general, a term NULL is used to denote an undefined value, an unknown value, or "no value has been entered yet."

Database systems vary and they might handle a value NULL differently. Refer to documentations of the database that you are using.

Filter proposal

While designing your form, you can set the "Filter proposal" property for each text box in the Data tab of the corresponding Properties dialog. In subsequent searches in the filter mode, you can select from all information contained in these fields. The field content can then be selected using the AutoComplete function. Note, however, that this function requires a greater amount of memory space and time, especially when used in large databases and should therefore be used sparingly.

Linked cell

Specifies the reference to a linked cell on a spreadsheet. The live state or contents of the control are linked to the cell contents. The following tables list the controls and their corresponding link type:

Check box with linked cell

Action

Result

Select the check box:

TRUE is entered into the linked cell.

Deselect the check box:

FALSE is entered into the linked cell.

Tri-state check box is set to "undetermined" state:

#NV is entered into the linked cell.

Enter a number or a formula that returns a number in the linked cell:

If entered value is TRUE or not 0: Check box is selected.
If entered value is FALSE or 0: Check box is deselected.

Clear the linked cell, or enter text, or enter a formula that returns text or an error:

Check box is set to "undetermined" state if it is a tri-state check box, else check box is deselected.

Select the box. The Reference value box contains text:

The text from the Reference value box is copied to the cell.

Deselect the box. The Reference value box contains text:

An empty string is copied to the cell.

The Reference value box contains text. Enter the same text into the cell:

The check box is selected.

The Reference value box contains text. Enter another text into the cell:

The check box is deselected.


Option button (radio button) with linked cell

Action

Result

Select the option button:

TRUE is entered into the linked cell.

Option button is deselected by selecting another option button:

FALSE is entered into the linked cell.

Enter a number or a formula that returns a number in the linked cell:

If entered value is TRUE or not 0: Option button is selected.
If entered value is FALSE or 0: Option button is deselected.

Clear the linked cell, or enter text, or enter a formula that returns text or an error:

Option button is deselected.

Click the option button. The Reference value box contains text:

The text from the Reference value box is copied to the cell.

Click another option button of the same group. The Reference value box contains text:

An empty string is copied to the cell.

The Reference value box contains text. Enter the same text into the cell:

The option button is selected.

The Reference value box contains text. Enter another text into the cell:

The option button is cleared.


Text box with linked cell

Action

Result

Enter text into the text box:

Text is copied into the linked cell.

Clear the text box:

Linked cell is cleared.

Enter text or a number in the linked cell:

Text or number is copied into the text box.

Enter a formula into the linked cell:

Formula result is copied into the text box.

Clear the linked cell:

Text box is cleared.


Numerical field and formatted field with linked cell

Action

Result

Enter a number into the field:

Number is copied into the linked cell.

Clear the field:

Value 0 is set in the linked cell.

Enter a number or a formula that returns a number in the linked cell:

Number is copied into the field.

Clear the linked cell, or enter text, or enter a formula that returns text or an error:

Value 0 is set in the field.


List box with linked cell

List boxes support two different linking modes, see the property "Contents of the linked cell".

  1. Linked contents: Synchronize the text contents of the selected list box entry with the cell contents.

  2. Linked selection position: The position of the single selected item in the list box is synchronized with the numerical value in the cell.

Action

Result

Select a single list item:

Contents are linked: Text of the item is copied into the linked cell.

Selection is linked: Position of the selected item is copied into the linked cell.
For example, if the third item is selected, the number 3 will be copied.

Select several list items:

#NV is entered into the linked cell.

Deselect all list items:

Contents are linked: Linked cell is cleared.

Selection is linked: Value 0 is entered in the linked cell.

Enter text or a number into the linked cell:

Contents are linked: Find and select an equal list item.

Selection is linked: The list item at the specified position (starting with 1 for the first item) is selected. If not found, all items are deselected.

Enter a formula into the linked cell:

Find and select a list item that matches the formula result and link mode.

Clear the linked cell:

Deselect all items in the list box.

Change the contents of the list source range:

List box items are updated according to the change. The selection is preserved. This may cause an update to the linked cell.


Combo box with linked cell

Action

Result

Enter text into the edit field of the combo box, or select an entry from the drop-down list:

Text is copied into the linked cell.

Clear the edit field of the combo box:

Linked cell is cleared.

Enter text or a number into the linked cell:

Text or number is copied into the edit field of the combo box.

Enter a formula into the linked cell:

Formula result is copied into the edit field of the combo box.

Clear the linked cell:

Edit field of the combo box is cleared.

Change the contents of the list source range:

Drop-down list items are updated according to the change. The edit field of the combo box and the linked cell are not changed.


List content

With database forms, specifies the data source for the list content of the form-element. This field can be used to define a value list for documents without a database connection.

In the case of database forms, the data source determines the entries of the list or combo box. Depending on the selected type, you have a choice between different data sources under List content, provided that these objects exist in your database. All available database objects of the type selected under Type of list contents are offered here. If you have selected the "Value List" option as the type, you can use references for database forms. If the display of the control is controlled by an SQL command, the SQL statement is entered here.

Examples of SQL statements:

For list boxes, an SQL statement may have the following form:

SELECT field1, field2 FROM table,

Here "table" is the table whose data is displayed in the list of the control (list table). "field1" is the data field that defines the visible entries in the form; its content is displayed in the list box. "field2" is the field of the list table that is linked to the form table (value table) through the field specified under Data field if Bound field = 1 was selected.

For combo boxes, an SQL statement may take the following form:

SELECT DISTINCT field FROM table,

Here "field" is a data field from the list table "table" whose content is displayed in the list of the combo box.

Value lists for HTML documents

For HTML forms, you can enter a value list under List content. Select the option "Valuelist" under Type of list contents. The values entered here will not be visible in the form, and are used to assign values to the visible entries. The entries made under List content correspond to the HTML tag <OPTION VALUE=...>.

In the data transfer of a selected entry from a list box or a combo box, both the list of the values displayed in the form, which was entered on the General tab under List entries, and the value list entered on the Data tab under List content, are taken into consideration: If a (non-empty) text is at the selected position in the value list (<OPTION VALUE=...>), it will be transmitted. Otherwise, the text displayed in the (<OPTION>) control is sent.

If the value list is to contain an empty string, enter the value "$$$empty$$$" under List content at the corresponding position (note uppercase/lowercase). LibreOffice interprets this input as an empty string and assigns it to the respective list entry.

The following table shows the connections between HTML, JavaScript, and the LibreOffice field List content using an example list box named "ListBox1". In this case, "Item" designates a list entry visible in the form:

HTML gairė

JavaScript

Entry in value list of the control (List content)

Transmitted data

<OPTION>elementas

Negalima

""

the visible list entry ("ListBox1=Item")

<OPTION VALUE="Value">Item

ListBox1.options[0].value="Value"

"Value"

The value assigned to the list entry ("ListBox1=Value")

<OPTION VALUE="">Item

ListBox1.options[0].value=""

"$$$empty$$$"

An empty string ("ListBox1=")


Nuorodos reikšmė (išjungta)

Žymimuosius langelius ir akutes skaičiuoklės dokumentuose galima susieti su veikiamojo dokumento langeliais. Jei valdiklis įgalintas, į langelį bus nukopijuota reikšmė iš lauko Nuorodos reikšmė (įjungta). Jei valdiklis išjungtas, į langelį kopijuojama lauko Nuorodos reikšmė (išjungta) reikšmė.

Nuorodos reikšmė (įjungta)

Čia galima įvesti žymimojo langelio arba akutės nuorodos reikšmę. Pateikus žiniatinklio formą, ši reikšmė bus išsiųsta į serverį. Duomenų bazės formos atveju reikšmė bus įrašyta į duomenų bazės lauką, susietą su valdiklio lauku.

Nuorodos reikšmės žiniatinklio formose

Nuorodos reikšmės naudingos tuomet, kai informaciją apie žiniatinklio formos valdiklio būseną reikia perduoti į serverį. Naudotojui spustelėjus valdiklį atitinkama nuorodos reikšmė nusiunčiama į serverį.

Pavyzdžiui, valdiklis turi dvi parinktis: „moteris“, kuriai priskirta nuorodos reikšmė 1, ir „vyras“, kuriai priskirta nuorodos reikšmė 2. Į serverį bus siunčiama reikšmė 1, jei naudotojas pažymės valdiklio parinktį „moteris“, o pažymėjus parinktį „vyras“, į serverį bus siunčiama reikšmė 2.

Nuorodos reikšmės duomenų bazės formose

Duomenų bazės formose žymimųjų langelių ir akučių būsenoms taip pat galima priskirti nuorodos reikšmes, kurios bus įrašytos į duomenų bazę. Pavyzdžiui, jei trims parinktims „Nauja“, „Vykdoma“ ir „Atmesta“ priskirtos nuorodos reikšmės NJ, VK ir AT, tokios reikšmės bus įrašytos į duomenų bazę pažymėjus atitinkamą parinktį.

Source cell range

Enter a cell range that contains the entries for a list box or combo box on a spreadsheet. If you enter a multi-column range, only the contents of the leftmost column are used to fill the control.

Susietasis laukas

note

If you delete the contents of the Bound field cell in the property browser, the first field of the result set is used to display and to exchange data.


This property for list boxes defines which data field of a linked table is displayed in the form.

If a list box in the form is to display contents of a table linked to the form table, then define in the Type of list contents field if the display is determined by an SQL command or the (linked) table is accessed. With the Bound field property, you use an index to specify to which data field of the query or of the table the list field is linked.

note

The property Bound field is only for forms that are used to access more than one table. If the form is based on only one table, the field to be displayed in the form is specified directly under Data field. However, if you want the list box to display data from a table that is linked to the current table over a common data field, the linked data field is defined by the property Bound field.


If you selected "SQL" under Type of list contents, the SQL command determines the index to be specified. Example: If you specify an SQL command such as "SELECT Field1, Field2 FROM tablename" under List content, refer to the following table:

Susietasis laukas

Susieti

-1

The index of the selected entry in the list is linked to the field specified under Data field.

{empty} or 0

The database field "Field1" is linked to the field specified under Data field.

1

The database field "Field2" is linked to the field specified under Data field.


If you selected "Table" under Type of list contents, the table structure defines the index to be specified. Example: If a database table is selected under List content, refer to the following table:

Susietasis laukas

Susieti

-1

The index of the selected entry in the list is linked to the field specified under Data field.

{empty} or 0

The 1st column of the table is linked to the field specified under Data field.

1

The 2nd column of the table is linked to the field specified under Data field.

2

The 3rd column of the table is linked to the field specified under Data field.


Sąrašo turinio tipas

Determines the data to fill the lists in list and combo boxes.

With the "Valuelist" option, all entries entered in the List entries field of the General tab appear in the control. For database forms, you can use reference values (see the References Using Value Lists section).

If the content of the control is read from a database, you can determine the type of the data source with the other options. For example, you can choose between tables and queries.

Paremkite mus!