# kexi__objectdata

o_data:
<!DOCTYPE UI>
<UI version="3.1" stdsetdef="1">
<kfd:customHeader version="2"/>
<pixmapinproject/>
<class>QWidget</class>
<widget class="QWidget">
<property name="name">
<string>formularz1</string>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>230</height>
</rect>
</property>
<property name="paletteBackgroundColor">
<color>
<red>97</red>
<green>147</green>
<blue>207</blue>
</color>
</property>
<property name="dataSource">
<string>persons</string>
</property>
<widget class="KexiDBLabel">
<property name="name">
<string>TextLabel1</string>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>40</y>
<width>152</width>
<height>36</height>
</rect>
</property>
<property name="alignment">
<set>AlignLeft|AlignTop</set>
</property>
<property name="alignment">
<set>AlignLeft|AlignTop</set>
</property>
<property name="shadowEnabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<family>Verdana</family>
<pointsize>14</pointsize>
<weight>50</weight>
<bold>0</bold>
<italic>0</italic>
<underline>0</underline>
<strikeout>0</strikeout>
</font>
</property>
<property name="text">
<string>Name</string>
</property>
<property name="dataSource">
<string>name</string>
</property>
</widget>
<widget class="Line">
<property name="name">
<string>Line1</string>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>80</y>
<width>450</width>
<height>11</height>
</rect>
</property>
<property name="lineWidth">
<number>3</number>
</property>
<property name="frameShadow">
<enum>Plain</enum>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
</widget>
<widget class="KexiDBLabel">
<property name="name">
<string>TextLabel2</string>
</property>
<property name="geometry">
<rect>
<x>180</x>
<y>40</y>
<width>182</width>
<height>36</height>
</rect>
</property>
<property name="alignment">
<set>AlignLeft|AlignTop</set>
</property>
<property name="alignment">
<set>AlignLeft|AlignTop</set>
</property>
<property name="shadowEnabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<family>Verdana</family>
<pointsize>14</pointsize>
<weight>50</weight>
<bold>0</bold>
<italic>0</italic>
<underline>0</underline>
<strikeout>0</strikeout>
</font>
</property>
<property name="text">
<string>Surname</string>
</property>
<property name="dataSource">
<string>surname</string>
</property>
</widget>
<widget class="KexiDBImageBox">
<property name="name">
<string>obrazek2</string>
</property>
<property name="geometry">
<rect>
<x>380</x>
<y>10</y>
<width>90</width>
<height>70</height>
</rect>
</property>
<property name="alignment">
<set>AlignRight|AlignTop</set>
</property>
<property name="storedPixmapId">
<number>6</number>
</property>
</widget>
<widget class="KexiDBLineEdit">
<property name="name">
<string>textBox</string>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>170</y>
<width>70</width>
<height>30</height>
</rect>
</property>
<property name="alignment">
<set>AlignRight|AlignVCenter</set>
</property>
<property name="dataSource">
<string>age</string>
</property>
</widget>
<widget class="KexiDBLineEdit">
<property name="name">
<string>textBox2</string>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>90</y>
<width>340</width>
<height>30</height>
</rect>
</property>
<property name="dataSource">
<string>name</string>
</property>
</widget>
<widget class="KexiDBLineEdit">
<property name="name">
<string>textBox3</string>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>130</y>
<width>340</width>
<height>30</height>
</rect>
</property>
<property name="dataSource">
<string>surname</string>
</property>
</widget>
</widget>
<includehints>
<includehint>klineedit.h</includehint>
</includehints>
<layoutDefaults spacing="6" margin="11"/>
<tabstops>
<tabstop>TextLabel1</tabstop>
<tabstop>TextLabel2</tabstop>
<tabstop>obrazek2</tabstop>
<tabstop>textBox</tabstop>
<tabstop>textBox2</tabstop>
<tabstop>textBox3</tabstop>
</tabstops>
</UI>


o_data:
<!DOCTYPE UI>
<UI version="3.1" stdsetdef="1">
<kfd:customHeader version="2"/>
<pixmapinproject/>
<class>QWidget</class>
<widget class="QWidget">
<property name="name">
<string>form1</string>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>220</height>
</rect>
</property>
<property name="paletteBackgroundColor">
<color>
<red>203</red>
<green>238</green>
<blue>185</blue>
</color>
</property>
<property name="focusPolicy">
<enum>NoFocus</enum>
</property>
<property name="dataSource">
<string>cars</string>
</property>
<widget class="KexiDBLabel">
<property name="name">
<string>TextLabel1</string>
</property>
<property name="geometry">
<rect>
<x>30</x>
<y>20</y>
<width>266</width>
<height>54</height>
</rect>
</property>
<property name="alignment">
<set>AlignLeft|AlignTop</set>
</property>
<property name="shadowEnabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<family>Verdana</family>
<pointsize>20</pointsize>
<weight>50</weight>
<bold>0</bold>
<italic>0</italic>
<underline>0</underline>
<strikeout>0</strikeout>
</font>
</property>
<property name="text">
<string>Cars</string>
</property>
<property name="dataSource">
<string>model</string>
</property>
</widget>
<widget class="KexiDBLabel">
<property name="name">
<string>TextLabel2</string>
</property>
<property name="geometry">
<rect>
<x>30</x>
<y>100</y>
<width>76</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>ID:</string>
</property>
</widget>
<widget class="KexiPushButton">
<property name="name">
<string>PushButton1</string>
</property>
<property name="geometry">
<rect>
<x>310</x>
<y>100</y>
<width>130</width>
<height>40</height>
</rect>
</property>
<property name="onClickAction">
<string>form:cars</string>
</property>
<property name="onClickActionOption">
<string>close</string>
</property>
<property name="text">
<string>Close Window</string>
</property>
</widget>
<widget class="KexiPushButton">
<property name="name">
<string>PushButton2</string>
</property>
<property name="geometry">
<rect>
<x>310</x>
<y>150</y>
<width>133</width>
<height>37</height>
</rect>
</property>
<property name="focusPolicy">
<enum>NoFocus</enum>
</property>
<property name="onClickAction">
<string>currentForm:data_save_row</string>
</property>
<property name="text">
<string>Save Changes</string>
</property>
</widget>
<widget class="KexiDBLabel">
<property name="name">
<string>TextLabel4</string>
</property>
<property name="geometry">
<rect>
<x>30</x>
<y>140</y>
<width>76</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>Model:</string>
</property>
</widget>
<widget class="KexiDBImageBox">
<property name="name">
<string>obrazek2</string>
</property>
<property name="geometry">
<rect>
<x>330</x>
<y>20</y>
<width>110</width>
<height>70</height>
</rect>
</property>
<property name="alignment">
<set>AlignRight|AlignTop</set>
</property>
<property name="storedPixmapId">
<number>8</number>
</property>
</widget>
<widget class="KexiDBLineEdit">
<property name="name">
<string>idEdit</string>
</property>
<property name="geometry">
<rect>
<x>110</x>
<y>140</y>
<width>180</width>
<height>31</height>
</rect>
</property>
<property name="focusPolicy">
<enum>WheelFocus</enum>
</property>
<property name="text">
<string>id</string>
</property>
<property name="dataSource">
<string>id</string>
</property>
</widget>
<widget class="KexiDBLineEdit">
<property name="name">
<string>modelEdit</string>
</property>
<property name="geometry">
<rect>
<x>110</x>
<y>100</y>
<width>180</width>
<height>31</height>
</rect>
</property>
<property name="focusPolicy">
<enum>WheelFocus</enum>
</property>
<property name="dataSource">
<string>model</string>
</property>
</widget>
</widget>
<includehints>
<includehint>kpushbutton.h</includehint>
<includehint>klineedit.h</includehint>
</includehints>
<layoutDefaults spacing="6" margin="11"/>
<tabstops>
<tabstop>idEdit</tabstop>
<tabstop>modelEdit</tabstop>
<tabstop>TextLabel1</tabstop>
<tabstop>TextLabel2</tabstop>
<tabstop>PushButton1</tabstop>
<tabstop>PushButton2</tabstop>
<tabstop>TextLabel4</tabstop>
<tabstop>obrazek2</tabstop>
</tabstops>
</UI>


o_data:
<!DOCTYPE script>
<script language="python" ># This is Technology Preview (BETA) version of scripting
# support in Kexi. The scripting API may change in details
# in the next Kexi version.
# For more information and documentation see
# http://www.kexi-project.org/scripting/

# Saves the contents of &quot;persons&quot; table, without the &quot;id&quot; column
# to a &quot;SimpleReport54321.txt&quot; text file in the current user's home
# directory. Totals about average, minimum, maximum age are appended.

import krosskexidb, krosskexiapp, os, codecs

keximainwindow = krosskexiapp.get(&quot;KexiAppMainWindow&quot;)
connection = keximainwindow.getConnection()
table = connection.tableSchema(&quot;persons&quot;)
if not table:
	raise(&quot;No table 'persons'&quot;)
query = table.query()

cursor = connection.executeQuerySchema(query)
if not cursor:
	raise(&quot;Query failed&quot;)

sum = 0
max = 0
min = 1000
count = 0

# Walk through all items in the table.
filename = os.path.expanduser(&quot;~&quot;)+os.sep+&quot;SimpleReport54321.txt&quot;
f = codecs.open(filename, &quot;wt&quot;, &quot;utf-8&quot;)
if not f:
	raise(&quot;Opening file failed&quot;)
f.write(&quot;%s\t%s\t%s\n-------------------------\n&quot; 
	% (query.fieldlist().field(1).caption(),
	query.fieldlist().field(2).caption(),
	query.fieldlist().field(3).caption()))
while cursor.moveNext():
	count += 1
	sum += cursor.value(1)
	if max &lt; cursor.value(1):
		max = cursor.value(1)
	if min > cursor.value(1):
		min = cursor.value(1)
	f.write( &quot;%s\t%s\t%s\n&quot; % (cursor.value(1), cursor.value(2),cursor.value(3)))

f.write( &quot;\nAverage age:\t%.2f\n&quot; % (sum / count) )
f.write( &quot;Minimum age:\t%.2f\n&quot; % min)
f.write( &quot;Maximum age:\t%.2f\n&quot; % max)
f.close()
</script>


o_sub_id: sql
o_data:
SELECT persons.name, persons.surname, persons.age, cars.model, ownership.since FROM persons, ownership, cars WHERE cars.id = ownership.car AND persons.id = ownership.owner


o_sub_id: query_layout
o_data:
<query_layout><table name="persons" x="380" y="54" width="110" height="132"/><table name="ownership" x="180" y="49" width="110" height="132"/><table name="cars" x="9" y="57" width="110" height="92"/><conn mtable="cars" mfield="id" dtable="ownership" dfield="car"/><conn mtable="persons" mfield="id" dtable="ownership" dfield="owner"/></query_layout>


o_sub_id: extended_schema
o_data:
<!DOCTYPE EXTENDED_TABLE_SCHEMA>
<EXTENDED_TABLE_SCHEMA version="1" >
 <field name="owner" >
  <lookup-column>
   <row-source>
    <type>table</type>
    <name>persons</name>
   </row-source>
   <bound-column>
    <number>0</number>
   </bound-column>
   <visible-column>
    <number>3</number>
   </visible-column>
  </lookup-column>
 </field>
 <field name="car" >
  <lookup-column>
   <row-source>
    <type>table</type>
    <name>cars</name>
   </row-source>
   <bound-column>
    <number>0</number>
   </bound-column>
   <visible-column>
    <number>1</number>
   </visible-column>
  </lookup-column>
 </field>
</EXTENDED_TABLE_SCHEMA>


o_data:
<!DOCTYPE UI>
<UI version="3.1" stdsetdef="1">
<kfd:customHeader version="2"/>
<pixmapinproject/>
<class>QWidget</class>
<widget class="QWidget">
<property name="name">
<string>form1</string>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>514</width>
<height>611</height>
</rect>
</property>
<property name="paletteBackgroundColor">
<color>
<red>154</red>
<green>168</green>
<blue>198</blue>
</color>
</property>
<property name="dataSource">
<string>ownership</string>
</property>
<widget class="KexiDBComboBox">
<property name="name">
<string>comboBox</string>
</property>
<property name="geometry">
<rect>
<x>100</x>
<y>120</y>
<width>121</width>
<height>26</height>
</rect>
</property>
<property name="dataSource">
<string>owner</string>
</property>
</widget>
<widget class="KexiDBComboBox">
<property name="name">
<string>comboBox2</string>
</property>
<property name="geometry">
<rect>
<x>100</x>
<y>160</y>
<width>121</width>
<height>26</height>
</rect>
</property>
<property name="dataSource">
<string>car</string>
</property>
</widget>
<widget class="KexiDBLabel">
<property name="name">
<string>label</string>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>120</y>
<width>55</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>Owner:</string>
</property>
</widget>
<widget class="KexiDBLabel">
<property name="name">
<string>label2</string>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>160</y>
<width>69</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>Car:</string>
</property>
</widget>
<widget class="KexiDBLabel">
<property name="name">
<string>label3</string>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>80</y>
<width>59</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>Since:</string>
</property>
</widget>
<widget class="KexiDBLineEdit">
<property name="name">
<string>textBox</string>
</property>
<property name="geometry">
<rect>
<x>100</x>
<y>80</y>
<width>172</width>
<height>26</height>
</rect>
</property>
<property name="dataSource">
<string>since</string>
</property>
</widget>
<widget class="KexiDBLabel">
<property name="name">
<string>TextLabel1</string>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>306</width>
<height>54</height>
</rect>
</property>
<property name="alignment">
<set>AlignLeft|AlignTop</set>
</property>
<property name="shadowEnabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<family>Verdana</family>
<pointsize>20</pointsize>
<weight>50</weight>
<bold>0</bold>
<italic>0</italic>
<underline>0</underline>
<strikeout>0</strikeout>
</font>
</property>
<property name="text">
<string>Ownership</string>
</property>
<property name="dataSource">
<string></string>
</property>
</widget>
<widget class="KexiDBImageBox">
<property name="name">
<string>image</string>
</property>
<property name="geometry">
<rect>
<x>350</x>
<y>20</y>
<width>145</width>
<height>119</height>
</rect>
</property>
<property name="alignment">
<set>AlignRight|AlignTop</set>
</property>
<property name="keepAspectRatio">
<bool>true</bool>
</property>
<property name="storedPixmapId">
<number>7</number>
</property>
</widget>
</widget>
<includehints>
<includehint>kcombobox.h</includehint>
<includehint>klineedit.h</includehint>
</includehints>
<layoutDefaults spacing="6" margin="11"/>
<tabstops>
<tabstop>comboBox</tabstop>
<tabstop>comboBox2</tabstop>
<tabstop>label</tabstop>
<tabstop>label2</tabstop>
<tabstop>label3</tabstop>
<tabstop>textBox</tabstop>
<tabstop>TextLabel1</tabstop>
<tabstop>image</tabstop>
</tabstops>
</UI>


o_data:
<!DOCTYPE macros>
<macro xmlversion="1" >
  <item action="open" >
    <variable name="name" >cars</variable>
    <variable name="object" >form</variable>
  </item>
  <item action="navigate" >
    <variable name="record" >last</variable>
  </item>
</macro>


o_sub_id: sql
o_data:
SELECT name, surname, age FROM persons WHERE persons.age > [Enter minimum person's age] ORDER BY age


o_sub_id: layout
o_data:
<!DOCTYPE kexireport>
<kexireport>
 <report:content xmlns:report="http://kexi-project.org/report/2.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0">
  <report:title>Report</report:title>
  <report:script report:script-interpreter=""></report:script>
  <report:grid report:grid-visible="1" report:grid-snap="1" report:page-unit="cm" report:grid-divisions="4"/>
  <report:page-style fo:margin-left="28.346505799999999pt" report:page-size="Letter" fo:margin-top="28.346505799999999pt" fo:margin-bottom="28.346505799999999pt" report:print-orientation="portrait" fo:margin-right="28.346505799999999pt">predefined</report:page-style>
  <report:body>
   <report:detail>
    <report:section svg:height="70.866264500005670pt" fo:background-color="#ffffff" report:section-type="detail"/>
   </report:detail>
  </report:body>
 </report:content>
 <connection source="" type="internal"/>
</kexireport>


o_sub_id: layout
o_data:
<!DOCTYPE kexireport>
<kexireport>
 <report:content xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:report="http://kexi-project.org/report/2.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0">
  <report:title>Report</report:title>
  <report:script report:script-interpreter=""></report:script>
  <report:grid report:grid-snap="1" report:grid-divisions="4" report:page-unit="cm" report:grid-visible="1"/>
  <report:page-style report:page-size="Letter" report:print-orientation="portrait" fo:margin-bottom="28.346505799999999pt" fo:margin-right="28.346505799999999pt" fo:margin-top="28.346505799999999pt" fo:margin-left="28.346505799999999pt">predefined</report:page-style>
  <report:body>
   <report:detail>
    <report:section svg:height="70.866264500005670pt" fo:background-color="#ffffff" report:section-type="detail"/>
   </report:detail>
  </report:body>
 </report:content>
 <connection type="internal" source=""/>
</kexireport>


