# kexi__objectdata

o_data:
<!DOCTYPE UI>
<UI stdsetdef="1" version="3.1" >
<kfd:customHeader version="2" />
<pixmapinproject/>
<class>TQWidget</class>
<widget class="TQWidget" >
<property name="name" >
<cstring>formularz1</cstring>
</property>
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>200</height>
</rect>
</property>
<property name="caption" >
<string>formularz1</string>
</property>
<property name="dataSource" >
<string>persons</string>
</property>
<property name="dataSourceMimeType" >
<cstring>kexi/table</cstring>
</property>
<property name="paletteBackgroundColor" >
<color>
<red>255</red>
<green>220</green>
<blue>168</blue>
</color>
</property>
<widget class="KexiDBLabel" >
<property name="name" >
<cstring>TextLabel1</cstring>
</property>
<property name="geometry" >
<rect>
<x>20</x>
<y>40</y>
<width>152</width>
<height>36</height>
</rect>
</property>
<property name="dataSource" >
<string>name</string>
</property>
<property name="font" >
<font>
<family>Verdana</family>
<pointsize>12</pointsize>
<weight>50</weight>
<bold>0</bold>
<italic>1</italic>
<underline>0</underline>
<strikeout>0</strikeout>
</font>
</property>
<property name="shadowEnabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>Name</string>
</property>
<property name="alignment" >
<set>WordBreak|AlignBottom</set>
</property>
</widget>
<widget class="Line" >
<property name="name" >
<cstring>Line1</cstring>
</property>
<property name="geometry" >
<rect>
<x>20</x>
<y>80</y>
<width>450</width>
<height>11</height>
</rect>
</property>
<property name="frameShadow" >
<enum>Plain</enum>
</property>
<property name="lineWidth" >
<number>3</number>
</property>
<property name="orientation" >
<enum>Horizontal</enum>
</property>
</widget>
<widget class="KexiDBLabel" >
<property name="name" >
<cstring>TextLabel2</cstring>
</property>
<property name="geometry" >
<rect>
<x>180</x>
<y>40</y>
<width>182</width>
<height>36</height>
</rect>
</property>
<property name="dataSource" >
<string>surname</string>
</property>
<property name="font" >
<font>
<family>Verdana</family>
<pointsize>12</pointsize>
<weight>50</weight>
<bold>0</bold>
<italic>1</italic>
<underline>0</underline>
<strikeout>0</strikeout>
</font>
</property>
<property name="shadowEnabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>Surname</string>
</property>
<property name="alignment" >
<set>WordBreak|AlignBottom</set>
</property>
</widget>
<widget class="KexiDBImageBox" >
<property name="name" >
<cstring>obrazek2</cstring>
</property>
<property name="geometry" >
<rect>
<x>380</x>
<y>10</y>
<width>90</width>
<height>70</height>
</rect>
</property>
<property name="alignment" >
<set>AlignTop|AlignRight</set>
</property>
<property name="storedPixmapId" >
<number>3</number>
</property>
</widget>
<widget class="KexiDBAutoField" >
<property name="name" >
<cstring>age</cstring>
</property>
<property name="geometry" >
<rect>
<x>20</x>
<y>150</y>
<width>148</width>
<height>21</height>
</rect>
</property>
<property name="dataSource" >
<string>age</string>
</property>
</widget>
<widget class="KexiDBAutoField" >
<property name="name" >
<cstring>name</cstring>
</property>
<property name="geometry" >
<rect>
<x>10</x>
<y>100</y>
<width>159</width>
<height>21</height>
</rect>
</property>
<property name="autoCaption" >
<bool>false</bool>
</property>
<property name="dataSource" >
<string>name</string>
</property>
</widget>
<widget class="KexiDBAutoField" >
<property name="name" >
<cstring>surname</cstring>
</property>
<property name="geometry" >
<rect>
<x>170</x>
<y>100</y>
<width>200</width>
<height>21</height>
</rect>
</property>
<property name="autoCaption" >
<bool>false</bool>
</property>
<property name="dataSource" >
<string>surname</string>
</property>
</widget>
</widget>
<layoutDefaults spacing="6" margin="11" />
<tabstops>
<tabstop>TextLabel1</tabstop>
<tabstop>TextLabel2</tabstop>
<tabstop>obrazek2</tabstop>
<tabstop>age</tabstop>
<tabstop>name</tabstop>
<tabstop>surname</tabstop>
</tabstops>
</UI>


o_data:
<!DOCTYPE UI>
<UI stdsetdef="1" version="3.1" >
 <pixmapinproject/>
 <class>TQWidget</class>
 <widget class="TQWidget" >
  <property name="name" >
   <cstring>report2</cstring>
  </property>
  <property name="geometry" >
   <rect>
    <x>0</x>
    <y>0</y>
    <width>590</width>
    <height>590</height>
   </rect>
  </property>
  <property name="caption" >
   <string></string>
  </property>
  <widget class="Label" >
   <property name="name" >
    <cstring>Label1</cstring>
   </property>
   <property name="geometry" >
    <rect>
     <x>10</x>
     <y>20</y>
     <width>566</width>
     <height>134</height>
    </rect>
   </property>
   <property name="backgroundOrigin" >
    <enum>ParentOrigin</enum>
   </property>
   <property name="font" >
    <font>
     <family>Trebuchet MS</family>
     <pointsize>48</pointsize>
     <weight>75</weight>
     <bold>1</bold>
     <italic>1</italic>
     <underline>0</underline>
     <strikeout>0</strikeout>
    </font>
   </property>
   <property name="text" >
    <string>Sales Report</string>
   </property>
  </widget>
  <widget class="PicLabel" >
   <property name="name" >
    <cstring>PicLabel1</cstring>
   </property>
   <property name="geometry" >
    <rect>
     <x>420</x>
     <y>170</y>
     <width>1</width>
     <height>1</height>
    </rect>
   </property>
   <property name="backgroundMode" >
    <enum>PaletteBackground</enum>
   </property>
   <property name="backgroundOrigin" >
    <enum>ParentOrigin</enum>
   </property>
   <property name="cursor" >
    <cursor>0</cursor>
   </property>
   <property name="frameShape" >
    <enum>NoFrame</enum>
   </property>
   <property name="pixmap" >
    <pixmap>image0</pixmap>
   </property>
   <property name="scaledContents" >
    <bool>true</bool>
   </property>
  </widget>
  <widget class="KexiSubReport" >
   <property name="name" >
    <cstring>SubReport1</cstring>
   </property>
   <property name="geometry" >
    <rect>
     <x>20</x>
     <y>170</y>
     <width>330</width>
     <height>290</height>
    </rect>
   </property>
  </widget>
 </widget>
 <images>
  <image name="image0" >
   <data format="XBM.GZ" length="79" >789c534e494dcbcc4b554829cdcdad8c2fcf4c29c95030e0524611cd48cd4ccf28010a1797249664262b2467241641a592324b8aa363156c15aab914146aadb90067111b1f</data>
  </image>
 </images>
 <layoutDefaults spacing="6" margin="11" />
 <tabstops>
  <tabstop>SubReport1</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 stdsetdef="1" version="3.1" >
<kfd:customHeader version="2" />
<pixmapinproject/>
<class>TQWidget</class>
<widget class="TQWidget" >
<property name="name" >
<cstring>form1</cstring>
</property>
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>514</width>
<height>611</height>
</rect>
</property>
<property name="autoTabStops" >
<bool>true</bool>
</property>
<property name="dataSource" >
<string>ownership</string>
</property>
<property name="dataSourceMimeType" >
<cstring>kexi/table</cstring>
</property>
<property name="paletteBackgroundColor" >
<color>
<red>154</red>
<green>168</green>
<blue>198</blue>
</color>
</property>
<widget class="KexiDBComboBox" >
<property name="name" >
<cstring>comboBox</cstring>
</property>
<property name="geometry" >
<rect>
<x>100</x>
<y>90</y>
<width>121</width>
<height>26</height>
</rect>
</property>
<property name="dataSource" >
<string>owner</string>
</property>
</widget>
<widget class="KexiDBComboBox" >
<property name="name" >
<cstring>comboBox2</cstring>
</property>
<property name="geometry" >
<rect>
<x>100</x>
<y>130</y>
<width>121</width>
<height>26</height>
</rect>
</property>
<property name="dataSource" >
<string>car</string>
</property>
</widget>
<widget class="KexiDBLabel" >
<property name="name" >
<cstring>label</cstring>
</property>
<property name="geometry" >
<rect>
<x>20</x>
<y>90</y>
<width>55</width>
<height>29</height>
</rect>
</property>
<property name="text" >
<string>Owner:</string>
</property>
</widget>
<widget class="KexiDBLabel" >
<property name="name" >
<cstring>label2</cstring>
</property>
<property name="geometry" >
<rect>
<x>20</x>
<y>130</y>
<width>69</width>
<height>29</height>
</rect>
</property>
<property name="text" >
<string>Car:</string>
</property>
</widget>
<widget class="KexiDBLabel" >
<property name="name" >
<cstring>label3</cstring>
</property>
<property name="geometry" >
<rect>
<x>20</x>
<y>170</y>
<width>59</width>
<height>29</height>
</rect>
</property>
<property name="text" >
<string>Since:</string>
</property>
</widget>
<widget class="KexiDBLineEdit" >
<property name="name" >
<cstring>textBox</cstring>
</property>
<property name="geometry" >
<rect>
<x>100</x>
<y>170</y>
<width>172</width>
<height>26</height>
</rect>
</property>
<property name="dataSource" >
<string>since</string>
</property>
</widget>
<widget class="KexiDBLabel" >
<property name="name" >
<cstring>TextLabel1</cstring>
</property>
<property name="geometry" >
<rect>
<x>30</x>
<y>20</y>
<width>266</width>
<height>44</height>
</rect>
</property>
<property name="dataSource" >
<string></string>
</property>
<property name="font" >
<font>
<family>Verdana</family>
<pointsize>16</pointsize>
<weight>75</weight>
<bold>1</bold>
<italic>0</italic>
<underline>0</underline>
<strikeout>0</strikeout>
</font>
</property>
<property name="paletteBackgroundPixmap" />
<property name="shadowEnabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>Ownership</string>
</property>
</widget>
<widget class="KexiDBImageBox" >
<property name="name" >
<cstring>image</cstring>
</property>
<property name="geometry" >
<rect>
<x>320</x>
<y>20</y>
<width>175</width>
<height>149</height>
</rect>
</property>
<property name="storedPixmapId" >
<number>5</number>
</property>
</widget>
</widget>
<includes>
<include location="global" impldecl="in implementation">kcombobox.h</include>
<include location="global" impldecl="in implementation">klineedit.h</include>
</includes>
<layoutDefaults spacing="6" margin="11" />
<tabstops>
<tabstop>TextLabel1</tabstop>
<tabstop>image</tabstop>
<tabstop>label</tabstop>
<tabstop>comboBox</tabstop>
<tabstop>label2</tabstop>
<tabstop>comboBox2</tabstop>
<tabstop>label3</tabstop>
<tabstop>textBox</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


