File: crosstab_example.xml

package info (click to toggle)
openrpt 3.3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 6,220 kB
  • ctags: 4,263
  • sloc: cpp: 31,332; ansic: 12,175; xml: 7,401; sh: 376; sql: 32; makefile: 21
file content (222 lines) | stat: -rwxr-xr-x 4,617 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!DOCTYPE openRPTDef>
<report>
 <title></title>
 <name>crosstabtest</name>
 <description></description>
 <parameter default="2010-01-01" active="true" listtype="static" type="string" name="1-StartDate" >
  <description></description>
 </parameter>
 <parameter default="2099-01-01" active="true" listtype="static" type="string" name="2-EndDate" >
  <description></description>
 </parameter>
 <size>Letter</size>
 <landscape/>
 <topmargin>25</topmargin>
 <bottommargin>25</bottommargin>
 <rightmargin>25</rightmargin>
 <leftmargin>25</leftmargin>
 <querysource>
  <name>crosstabdetail</name>
  <sql>SELECT 
     cohead_id, 
     (
      SELECT (cohead_number || ' - ' || cust_number) as co_cust 
      FROM custinfo 
      WHERE cohead_cust_id = cust_id
     ) AS co_cust, 
     coitem_linenumber, 
     (
      SELECT item_number || ' - ' || formatQty(coitem_qtyord) || ' - ' || coitem_status 
      FROM item, itemsite 
      WHERE coitem_itemsite_id = itemsite_id AND itemsite_item_id = item_id
     ) AS item_number_qty_status
FROM cohead JOIN coitem ON (cohead_id=coitem_cohead_id)
WHERE 
     --coitem_status NOT IN ('X','C')
     cohead_orderdate BETWEEN &lt;? value("1-StartDate") ?> AND &lt;? value("2-EndDate") ?>
ORDER BY cohead_number DESC, coitem_linenumber;</sql>
 </querysource>
 <pghead>
  <height>100</height>
  <label>
   <rect>
    <x>345</x>
    <y>0</y>
    <width>360</width>
    <height>25</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>S/O Lines by S/O</string>
  </label>
  <field>
   <rect>
    <x>500</x>
    <y>40</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>Parameter Query</query>
    <column>1-StartDate</column>
   </data>
  </field>
  <field>
   <rect>
    <x>500</x>
    <y>60</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>Parameter Query</query>
    <column>2-EndDate</column>
   </data>
  </field>
  <label>
   <rect>
    <x>460</x>
    <y>60</y>
    <width>45</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <string>To:</string>
  </label>
  <label>
   <rect>
    <x>460</x>
    <y>40</y>
    <width>45</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <string>From:</string>
  </label>
 </pghead>
 <section>
  <name>CrosstabSection</name>
  <detail>
   <key>
    <query>crosstabdetail</query>
   </key>
   <height>360</height>
   <crosstab>
    <rect>
     <x>5</x>
     <y>85</y>
     <width>210.759</width>
     <height>59.9819</height>
     <bgcolor>
      <red>170</red>
      <green>170</green>
      <blue>255</blue>
     </bgcolor>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <data>
     <query>crosstabdetail</query>
    </data>
    <table>
     <wrappolicy>rows</wrappolicy>
     <showcolumnheaderagain>yes</showcolumnheaderagain>
     <showrowheaderagain>yes</showrowheaderagain>
     <CellMargins>
      <Left>0</Left>
      <Right>0</Right>
      <Top>0</Top>
      <Bottom>0</Bottom>
     </CellMargins>
    </table>
    <column>
     <queryColumn>coitem_linenumber</queryColumn>
     <HAlign>Center</HAlign>
     <VAlign>Center</VAlign>
    </column>
    <row>
     <queryColumn>co_cust</queryColumn>
     <HAlign>Left</HAlign>
     <VAlign>Center</VAlign>
    </row>
    <value>
     <queryColumn>item_number_qty_status</queryColumn>
     <HAlign>Right</HAlign>
     <VAlign>Center</VAlign>
    </value>
   </crosstab>
  </detail>
 </section>
 <pgfoot>
  <height>100</height>
  <label>
   <rect>
    <x>515</x>
    <y>15</y>
    <width>40</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <string>Page:</string>
  </label>
  <field>
   <rect>
    <x>555</x>
    <y>15</y>
    <width>35</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>Context Query</query>
    <column>page_number</column>
   </data>
  </field>
 </pgfoot>
</report>