How should I box multiple same objects in the same image [closed] - machine-learning

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am using labelImg to create .xml files for training images. While training photos, I've come across a photo containing more than one of the same objects in the same photo.
For example, the photo below contains tens of swimmers in the same photo. Now, when I train custom objects for object recognition task, I create one .xml file for corresponding .jpg file. But here, I will end up with many .xml files from the same photo. So, I don't know what to do here.
Please help.

labelIMG allows you to create an xml file with multiple boxes of the same class, just save it as PascalVOC format:
Result:
<annotation>
<folder>img</folder>
<filename>Pcf5D.png</filename>
<path>/home/Desktop/img/Pcf5D.png</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>527</width>
<height>393</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>64</xmin>
<ymin>270</ymin>
<xmax>105</xmax>
<ymax>310</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>87</xmin>
<ymin>123</ymin>
<xmax>114</xmax>
<ymax>145</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>90</xmin>
<ymin>144</ymin>
<xmax>116</xmax>
<ymax>168</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>127</xmin>
<ymin>119</ymin>
<xmax>146</xmax>
<ymax>162</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>166</xmin>
<ymin>164</ymin>
<xmax>183</xmax>
<ymax>202</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>119</xmin>
<ymin>201</ymin>
<xmax>138</xmax>
<ymax>238</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>146</xmin>
<ymin>225</ymin>
<xmax>156</xmax>
<ymax>259</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>180</xmin>
<ymin>246</ymin>
<xmax>197</xmax>
<ymax>286</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>18</xmin>
<ymin>364</ymin>
<xmax>43</xmax>
<ymax>391</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>164</xmin>
<ymin>353</ymin>
<xmax>181</xmax>
<ymax>392</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>184</xmin>
<ymin>353</ymin>
<xmax>199</xmax>
<ymax>389</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>216</xmin>
<ymin>276</ymin>
<xmax>242</xmax>
<ymax>300</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>235</xmin>
<ymin>301</ymin>
<xmax>251</xmax>
<ymax>331</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>250</xmin>
<ymin>261</ymin>
<xmax>270</xmax>
<ymax>301</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>270</xmin>
<ymin>261</ymin>
<xmax>288</xmax>
<ymax>300</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>292</xmin>
<ymin>259</ymin>
<xmax>307</xmax>
<ymax>302</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>266</xmin>
<ymin>211</ymin>
<xmax>287</xmax>
<ymax>252</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>273</xmin>
<ymin>133</ymin>
<xmax>293</xmax>
<ymax>163</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>149</xmin>
<ymin>150</ymin>
<xmax>160</xmax>
<ymax>184</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>129</xmin>
<ymin>83</ymin>
<xmax>142</xmax>
<ymax>119</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>101</xmin>
<ymin>51</ymin>
<xmax>123</xmax>
<ymax>91</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>116</xmin>
<ymin>17</ymin>
<xmax>132</xmax>
<ymax>53</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>134</xmin>
<ymin>8</ymin>
<xmax>151</xmax>
<ymax>56</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>151</xmin>
<ymin>9</ymin>
<xmax>172</xmax>
<ymax>56</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>155</xmin>
<ymin>56</ymin>
<xmax>175</xmax>
<ymax>93</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>142</xmin>
<ymin>81</ymin>
<xmax>158</xmax>
<ymax>114</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>185</xmin>
<ymin>45</ymin>
<xmax>198</xmax>
<ymax>90</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>216</xmin>
<ymin>37</ymin>
<xmax>239</xmax>
<ymax>72</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>154</xmin>
<ymin>243</ymin>
<xmax>168</xmax>
<ymax>273</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>166</xmin>
<ymin>261</ymin>
<xmax>180</xmax>
<ymax>275</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>298</xmin>
<ymin>223</ymin>
<xmax>316</xmax>
<ymax>259</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>311</xmin>
<ymin>189</ymin>
<xmax>328</xmax>
<ymax>219</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>306</xmin>
<ymin>148</ymin>
<xmax>323</xmax>
<ymax>183</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>317</xmin>
<ymin>115</ymin>
<xmax>336</xmax>
<ymax>150</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>354</xmin>
<ymin>107</ymin>
<xmax>368</xmax>
<ymax>148</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>340</xmin>
<ymin>12</ymin>
<xmax>354</xmax>
<ymax>28</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>390</xmin>
<ymin>45</ymin>
<xmax>412</xmax>
<ymax>83</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>411</xmin>
<ymin>89</ymin>
<xmax>430</xmax>
<ymax>125</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>432</xmin>
<ymin>94</ymin>
<xmax>454</xmax>
<ymax>143</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>453</xmin>
<ymin>21</ymin>
<xmax>478</xmax>
<ymax>63</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>405</xmin>
<ymin>1</ymin>
<xmax>435</xmax>
<ymax>30</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>364</xmin>
<ymin>1</ymin>
<xmax>384</xmax>
<ymax>15</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>354</xmin>
<ymin>19</ymin>
<xmax>370</xmax>
<ymax>48</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>342</xmin>
<ymin>16</ymin>
<xmax>352</xmax>
<ymax>48</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>466</xmin>
<ymin>69</ymin>
<xmax>491</xmax>
<ymax>104</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>488</xmin>
<ymin>27</ymin>
<xmax>505</xmax>
<ymax>67</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>513</xmin>
<ymin>41</ymin>
<xmax>527</xmax>
<ymax>93</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>491</xmin>
<ymin>105</ymin>
<xmax>507</xmax>
<ymax>150</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>514</xmin>
<ymin>115</ymin>
<xmax>527</xmax>
<ymax>154</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>409</xmin>
<ymin>134</ymin>
<xmax>431</xmax>
<ymax>175</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>380</xmin>
<ymin>153</ymin>
<xmax>391</xmax>
<ymax>187</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>344</xmin>
<ymin>157</ymin>
<xmax>367</xmax>
<ymax>203</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>347</xmin>
<ymin>207</ymin>
<xmax>365</xmax>
<ymax>246</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>316</xmin>
<ymin>244</ymin>
<xmax>335</xmax>
<ymax>274</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>325</xmin>
<ymin>210</ymin>
<xmax>344</xmax>
<ymax>239</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>353</xmin>
<ymin>269</ymin>
<xmax>373</xmax>
<ymax>302</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>339</xmin>
<ymin>259</ymin>
<xmax>356</xmax>
<ymax>296</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>315</xmin>
<ymin>293</ymin>
<xmax>337</xmax>
<ymax>337</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>299</xmin>
<ymin>340</ymin>
<xmax>314</xmax>
<ymax>378</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>317</xmin>
<ymin>339</ymin>
<xmax>340</xmax>
<ymax>383</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>486</xmin>
<ymin>344</ymin>
<xmax>517</xmax>
<ymax>381</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>447</xmin>
<ymin>301</ymin>
<xmax>466</xmax>
<ymax>347</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>396</xmin>
<ymin>271</ymin>
<xmax>414</xmax>
<ymax>311</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>364</xmin>
<ymin>224</ymin>
<xmax>387</xmax>
<ymax>262</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>442</xmin>
<ymin>231</ymin>
<xmax>462</xmax>
<ymax>274</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>406</xmin>
<ymin>241</ymin>
<xmax>429</xmax>
<ymax>279</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>392</xmin>
<ymin>157</ymin>
<xmax>412</xmax>
<ymax>198</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>458</xmin>
<ymin>188</ymin>
<xmax>478</xmax>
<ymax>227</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>429</xmin>
<ymin>181</ymin>
<xmax>450</xmax>
<ymax>226</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>413</xmin>
<ymin>179</ymin>
<xmax>431</xmax>
<ymax>219</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>500</xmin>
<ymin>250</ymin>
<xmax>513</xmax>
<ymax>284</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>496</xmin>
<ymin>173</ymin>
<xmax>513</xmax>
<ymax>209</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>506</xmin>
<ymin>201</ymin>
<xmax>526</xmax>
<ymax>242</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>37</xmin>
<ymin>323</ymin>
<xmax>65</xmax>
<ymax>354</ymax>
</bndbox>
</object>
</annotation>

Related

accessibilityIdentifier not working the same starting with iOS 15

The app on which I am working has it's ui tested using Appium. Because of this, I set accessibility identifiers on views.
struct RootView: View {
var body: some View {
VStack {
Text("some text")
Text("more text")
}
// wrapper 1
.accessibilityElement(children: .contain)
.accessibilityIdentifier("ID 1111111111111")
// wrapper 2
.accessibilityElement(children: .contain)
.accessibilityIdentifier("ID 2222222222222")
}
}
(the code is oversimplified to ease the understanding of the problem)
Running the code above on iOS 14 would output this on Appium Inspector when inspecting the views:
<XCUIElementTypeOther type="XCUIElementTypeOther" name="ID 2222222222222" enabled="true" visible="true" accessible="false" x="157" y="408" width="76" height="41" index="0">
<XCUIElementTypeOther type="XCUIElementTypeOther" name="ID 1111111111111" enabled="true" visible="true" accessible="false" x="157" y="408" width="76" height="41" index="0">
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="some text" name="some text" label="some text" enabled="true" visible="true" accessible="true" x="157" y="408" width="76" height="21" index="0"/>
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="more text" name="more text" label="more text" enabled="true" visible="true" accessible="true" x="159" y="428" width="73" height="21" index="1"/>
</XCUIElementTypeOther>
</XCUIElementTypeOther>
So each group of accessibilityElement and accessibilityIdentifier would create a XCUIElementTypeOther with the same name property as the id set by accessibilityIdentifier.
With iOS 15/16 these are not working anymore, here is the output on Appium Inspector when inspecting the views:
<XCUIElementTypeOther type="XCUIElementTypeOther" name="ID 2222222222222" enabled="true" visible="true" accessible="false" x="157" y="408" width="76" height="41" index="0">
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="some text" name="some text" label="some text" enabled="true" visible="true" accessible="true" x="157" y="408" width="76" height="21" index="0"/>
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="more text" name="more text" label="more text" enabled="true" visible="true" accessible="true" x="158" y="428" width="74" height="21" index="1"/>
</XCUIElementTypeOther>
It looks like the first group of accessibilityElement and accessibilityIdentifier is no longer generating an XCUIElementTypeOther.
Is there a way to have the same output of iOS 14 on iOS 15/16?

Theme Resources to define gradient stop color UWP

I am creating UWP application.I have few LinearGradientBrushes, where the color is set directly in the LinearGradientBrush reference as GradientStops. However, I want to have a predefined set of colors defined in the resource distionary that I can use a a reference for each GradientStop, so that changing the color scheme for the application is a matter of changing the values of the SolidColorBrushes:
<!--Resource Dictionary -->
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="stop1" Color="#FF5A5A5A"/>
<SolidColorBrush x:Key="stop2" Color="#FF222222"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="stop1" Color="Black"/>
<SolidColorBrush x:Key="stop2" Color="White"/>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="stop1" Color="Black"/>
<SolidColorBrush x:Key="stop2" Color="White"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<!-- control Template-->
<LinearGradientBrush x:Key="gradient">
<GradientStop Color="{Binding Source={Themeresource stop1},Path=Color}" Offset="0"/>
<GradientStop Color="{Binding Source={Themeresource stop2},Path=Color}" Offset="1"/>
</LinearGradientBrush>
Its Giving error that nam/key stop1 is not Found
The problem is stop1 is static resource but not Themeresource . So, we need edit binding source as StaticResource.
<LinearGradientBrush x:Key="gradient">
<GradientStop Color="{Binding Source={StaticResource stop1},Path=Color}" Offset="0"/>
<GradientStop Color="{Binding Source={StaticResource stop2},Path=Color}" Offset="1"/>
</LinearGradientBrush>
Update
For the testing, if we place above in ResourceDictionary, it will work.
<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="stop1" Color="#FF5A5A5A"/>
<SolidColorBrush x:Key="stop2" Color="#FF222222"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="stop1" Color="Black"/>
<SolidColorBrush x:Key="stop2" Color="White"/>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="stop1" Color="Black"/>
<SolidColorBrush x:Key="stop2" Color="White"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<!-- control Template-->
<LinearGradientBrush x:Key="gradient">
<GradientStop Color="{Binding Source={ThemeResource stop1},Path=Color}" Offset="0"/>
<GradientStop Color="{Binding Source={ThemeResource stop2},Path=Color}" Offset="1"/>
</LinearGradientBrush>
</ResourceDictionary>
</Page.Resources>
The above problem can be solved by using binding
public LinearGradientBrush GradientBrush
{
get { return _GradientBrush; }
set
{
_GradientBrush = value;
RaisePropertyChanged("GradientBrush");
}
}
GradientBrush = GetGradientBrush();
public static LinearGradientBrush GetGradientBrush()
{
var grColor1 = ((SolidColorBrush)Application.Current.Resources["stop1"]).Color;
var grColor2 = ((SolidColorBrush)Application.Current.Resources["stop2"]).Color;
LinearGradientBrush lgBrush = new LinearGradientBrush();
lgBrush.GradientStops.Add(new GradientStop() { Color = grColor1, Offset = 0.1 });
lgBrush.GradientStops.Add(new GradientStop() { Color = grColor2, Offset = 0.9 });
lgBrush.StartPoint = new Point(0, 1);
lgBrush.EndPoint = new Point(1, 0);
return lgBrush;
}
<Grid Background="{Binding GradientBrush}" >

OData Model Not Working

I am trying to use expand option in my XML view but it's resulting no data.
Data are coming from backend as I can see in debugging under 'Network' option but there seems to be some binding issue in XML view.
Component.js
sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/Device",
"sem/stock_app/model/models"
], function(UIComponent, Device, models) {
"use strict";
return UIComponent.extend("sem.stock_app.Component", {
metadata: {
manifest: "json"
},
/**
* The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
* #public
* #override
*/
init: function() {
var url = "/sap/opu/odata/sap/ZMATLIST_SRV_02";
var odata = new sap.ui.model.odata.ODataModel(url, {
json: true
});
this.setModel(odata);
UIComponent.prototype.init.apply(this, arguments);
this.getRouter().initialize();
this.setModel(models.createDeviceModel(), "device");
}
});
});
manifest.json
{
"_version": "1.7.0",
"sap.app": {
"id": "sem.stock_app",
"type": "application",
"i18n": "i18n/i18n.properties",
"applicationVersion": {
"version": "1.0.0"
},
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"sourceTemplate": {
"id": "ui5template.basicSAPUI5ApplicationProject",
"version": "1.40.12"
}
},
"sap.ui": {
"technology": "UI5",
"icons": {
"icon": "",
"favIcon": "",
"phone": "",
"phone#2": "",
"tablet": "",
"tablet#2": ""
},
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
},
"supportedThemes": [
"sap_hcb",
"sap_belize"
]
},
"sap.ui5": {
"rootView": {
"viewName": "sem.stock_app.view.mat",
"type": "XML"
},
"dependencies": {
"minUI5Version": "1.30.0",
"libs": {
"sap.ui.core": {},
"sap.m": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "sem.stock_app.i18n.i18n"
}
}
},
"resources": {
"css": [{
"uri": "css/style.css"
}]
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "sem.stock_app.view",
"controlId": "idAppControl",
"controlAggregation": "pages"
},
"routes": [{
"name": "r1",
"pattern": "",
"target": "t1"
},
{
"name": "r2",
"pattern": "page2/{noti}",
"target": "t2"
}],
"targets": {
"t1": {
"viewName": "mat",
"viewId": "idmat",
"controlAggregation": "pages",
"viewLevel": 1
},
"t2": {
"viewName": "table",
"viewId": "idtable",
"controlAggregation": "pages",
"viewLevel": 2
}
}
}
}
}
Root View
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
xmlns:core="sap.ui.core"
controllerName="sem.stock_app.controller.mat"
displayBlock="true"
>
<App id="idAppControl">
<Page title="Material Input">
<Label text="Material Selection"/>
<Input id="materialInput"
type="Text"
width="50%"
placeholder="Enter Material"
showSuggestion="true"
showValueHelp="false"
valueHelpRequest="handleValueHelp"
submit="onSubmit"
suggestionItems="{/matlistSet}"
>
<suggestionItems>
<core:Item text="{Matid}"/>
</suggestionItems>
</Input>
<Button text="Get Details" enabled="true" press="myPress"/>
</Page>
</App>
</mvc:View>
Table View
<mvc:View
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
controllerName="sem.stock_app.controller.table"
>
<App id="tableApp">
<Page
title="Table"
showNavButton="true"
navButtonPress="onNavBack"
>
<Table
growing="true"
items="{
path: 'odata>/matlistSet',
parameters: {
expand: 'NP_ON_MATID'
}
}"
itemPress="onListItemPressed"
width="100%"
mode="MultiSelect"
>
<columns>
<Column>
<Text text="Material ID"/>
</Column>
<Column>
<Text text="Category"/>
</Column>
<Column>
<Text text="Material Desc"/>
</Column>
<Column>
<Text text="Plant"/>
</Column>
</columns>
<items>
<ColumnListItem type="Active">
<Text text="{odata>NP_ON_MATID/Matid}"/>
<Text text="{odata>NP_ON_MATID/Category}"/>
<Text text="{odata>NP_ON_MATID/Matdesc}"/>
<Text text="{odata>NP_ON_MATID/Plant}"/>
</ColumnListItem>
</items>
</Table>
</Page>
</App>
</mvc:View>
Table Controller
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/ui/core/routing/History"
], function(Controller, History) {
"use strict";
return Controller.extend("sem.stock_app.controller.table", {
onInit: function() {this.getOwnerComponent().getRouter().getRoute("r2").attachPatternMatched(this.mynav, this);
this.getOwnerComponent().getRouter().setView("table");
},
mynav: function(oeve) {
var data = oeve.getParameters().arguments.noti;
var params = "('" + data + "')?$expand=NP_ON_MATID";
var path = "/matlistSet" + params + "";
this.getView().bindElement(path);
},
onNavBack: function(window) {
var oHistory = History.getInstance();
var sPreviousHash = oHistory.getPreviousHash();
if (sPreviousHash !== undefined) {
window.history.go(-1);
} else {
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.navTo("overview", {}, true);
}
},
});
});
metadata.xml
<?xml version="1.0" encoding="utf-8" ?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData">
<edmx:DataServices m:DataServiceVersion="2.0">
<Schema Namespace="ZMATLIST_SRV_02" xml:lang="en" sap:schema-version="1" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
<EntityType Name="matlist" sap:content-version="1">
<Key>
<PropertyRef Name="Matid" />
</Key>
<Property Name="Matid" Type="Edm.String" Nullable="false" MaxLength="18" sap:unicode="false" sap:label="Material" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Category" Type="Edm.String" Nullable="false" MaxLength="20" sap:unicode="false" sap:label="Char20" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Matdesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:unicode="false" sap:label="Char" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Plant" Type="Edm.String" Nullable="false" MaxLength="4" sap:unicode="false" sap:label="Plant" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Status" Type="Edm.String" Nullable="false" MaxLength="20" sap:unicode="false" sap:label="Char20" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Qty" Type="Edm.Decimal" Nullable="false" Precision="13" Scale="3" sap:unicode="false" sap:label="Quantity" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<NavigationProperty Name="NP_ON_MATID" Relationship="ZMATLIST_SRV_02.MATASSOCIATION" FromRole="FromRole_MATASSOCIATION" ToRole="ToRole_MATASSOCIATION" />
</EntityType>
<EntityType Name="matdetails" sap:content-version="1">
<Key>
<PropertyRef Name="Matid" />
</Key>
<Property Name="Matid" Type="Edm.String" Nullable="false" MaxLength="18" sap:unicode="false" sap:label="Material" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Matitno" Type="Edm.Int32" Nullable="false" sap:unicode="false" sap:label="Number" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Category" Type="Edm.String" Nullable="false" MaxLength="20" sap:unicode="false" sap:label="Char20" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Matdesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:unicode="false" sap:label="Char" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
<Property Name="Plant" Type="Edm.String" Nullable="false" MaxLength="4" sap:unicode="false" sap:label="Plant" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" />
</EntityType>
<Association Name="MATASSOCIATION" sap:content-version="1">
<End Type="ZMATLIST_SRV_02.matlist" Multiplicity="1" Role="FromRole_MATASSOCIATION" />
<End Type="ZMATLIST_SRV_02.matdetails" Multiplicity="*" Role="ToRole_MATASSOCIATION" />
<ReferentialConstraint>
<Principal Role="FromRole_MATASSOCIATION">
<PropertyRef Name="Matid" />
</Principal>
<Dependent Role="ToRole_MATASSOCIATION">
<PropertyRef Name="Matid" />
</Dependent>
</ReferentialConstraint>
</Association>
<EntityContainer Name="ZMATLIST_SRV_02_Entities" m:IsDefaultEntityContainer="true" sap:supported-formats="atom json xlsx">
<EntitySet Name="matlistSet" EntityType="ZMATLIST_SRV_02.matlist" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:content-version="1" />
<EntitySet Name="matdetailsSet" EntityType="ZMATLIST_SRV_02.matdetails" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:content-version="1" />
<AssociationSet Name="MATASSOCIATIONSet" Association="ZMATLIST_SRV_02.MATASSOCIATION" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
<End EntitySet="matlistSet" Role="FromRole_MATASSOCIATION" />
<End EntitySet="matdetailsSet" Role="ToRole_MATASSOCIATION" />
</AssociationSet>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
Issues to fix
Backend
According to your service metadata, the foreign key inside matdetails is also the only primary key at the same time. I.e. the Matids in matdetails cannot be unique if one matlist is supposed be associated with multiple matdetails entities.
→ Make sure that primary keys (or them combined) are all unique in the entire entity set.
According to your screenshot, the response body of your entity set doesn't contain the property "results" which is not OData V2 compliant (Same as this issue. See also difference between OData V1 and OData V2). The "response" property needs to be there in each collection so that UI5 can display the items correctly.
→ Make sure that the response body is OData V2 compliant.
Frontend
Model
There was no model name passed when calling setModel.
→ Either pass the model name according to your view: this.setModel(odata, "odata")
→ Or remove the model name from everywhere. E.g.: <Text text="{Matid}"/>
Also worth reading: Stop Using sap.ui.model.odata.ODataModel!
UI
The root view and its controller are instantiating twice. In order to avoid that, please read:
→ Why is my Main Controller being called twice?
→ Discussion in https://github.com/SAP/openui5/issues/1746
The application contains <App> multiple times. A typical UI5 application should contain only a single root element. If not, you might end up having this kind of problems.
→ Remove all the <App> from views except from the root view.
Since you want to display matdetails entities of selected matlist entity in the table, binding items there with the absolute path /matlistSet doesn't make sense.
→ Replace ...
items="{
path: 'odata>/matlistSet',
parameters: {
expand: 'NP_ON_MATID'
}
}
... with items="{ path: 'odata>NP_ON_MATID', templateShareable: false }". This binding is now relative. The navigation property NP_ON_MATID will be resolved once the selected context is given in the controller. See also Binding Path from the documentation.
Controller
On patternMatched, the selected Matid value is given. So far so good but there are two anti-patterns in the following lines:
var params = "('" + data + "')?$expand=NP_ON_MATID";
var path = "/matlistSet" + params + "";
→ Avoid creating entity key(s) manually.
→ Avoid appending ?$expand manually as it won't expand the entity. Pass the navigation property to the parameters/expand of bindElement/bindObject instead.
Off-topic but if you want to navigate back: Remove window parameter from onNavBack: function(window) { ... }. Otherwise, the window in window.history.go is not the global window object but the press event from the back button.

Custom Silverlight button with <Path> content and visual states

I would like to create a button control that has a Path element as its content--an IconButton if you will.
This button should fulfill two conditions:
1. The Path element's stroke and fill colors should be available for manipulation by the VisualStateManager.
2. The Path element's data string (which defines it's shape) can be set in code or in XAML, so that I can create several such buttons without creating a new custom control for each.
The only way I can see to do it would involve no XAML whatsoever. That is, setting all the visual states and animations in the code behind, plus generating the Geometry objects point by point (and not being able to use the convenient Data string property on the Path element).
Is there a simpler way to do this?
EDIT
So one of the limitations I'm running into is that Silverlight does not support the mini-language for path expressions in PathGeometry, only in Path. I've got some detailed geometry going on in some of these icons, and I really don't want to take the convenient strings I generated with an Illustrator plug-in (pretty sure it was this one) and make them into separate line segments and curves.
Nice one Chris. If you want to store the paths as resources, you can modify things a bit like so:
First change the dependency property to a Path type:
/// <summary>
/// Button that contains an icon, where the icon is drawn from a path.
/// </summary>
public class IconButton : Button
{
/// <summary>
/// The path data that draws the icon.
/// </summary>
public static readonly DependencyProperty IconPathProperty =
DependencyProperty.Register("IconPath", typeof(Path), typeof(IconButton), new PropertyMetadata(default(Path)));
/// <summary>
/// Depencendy property backer.
/// </summary>
public Path IconPath
{
get { return (Path)GetValue(IconPathProperty); }
set { SetValue(IconPathProperty, value); }
}
}
Next, here's the IconButton control template.
<!-- Icon Button Control Template -->
<ControlTemplate x:Key="IconButtonControlTemplate" TargetType="{x:Type usercontrols:IconButton}">
<Grid x:Name="Grid">
<Border SnapsToDevicePixels="True" x:Name="Border" CornerRadius="1" BorderThickness="1" BorderBrush="{StaticResource ButtonBorderBrush}">
<Path x:Name="Icon" Height="16" Width="16" Stretch="Fill"
Data="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IconPath.Data}"
UseLayoutRounding="False" Grid.Column="1" VerticalAlignment="Center" Margin="0">
<Path.Fill>
<SolidColorBrush x:Name="IconColor" Color="{Binding Color, Source={StaticResource ButtonIconBrush}}" />
</Path.Fill>
</Path>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="BorderBrush" Value="{StaticResource ButtonBorderBrush}" TargetName="Border"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{StaticResource ButtonBackgroundMouseOverBrush}" TargetName="Border"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonBorderMouseOverBrush}" TargetName="Border"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" Value="{StaticResource ButtonBackgroundPressedBrush}" TargetName="Border"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Fill" Value="{StaticResource DisabledIconBrush}" TargetName="Icon"/>
<Setter Property="Background" Value="{StaticResource ButtonBackgroundDisabledBrush}" TargetName="Border"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonBorderDisabledBrush}" TargetName="Border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
... and here's the IconButton style that uses this template, and adds a few defaults:
<!-- Icon Button Style -->
<Style TargetType="{x:Type usercontrols:IconButton}">
<Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Height" Value="26"/>
<Setter Property="Width" Value="26"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Content" Value="Button"/>
<Setter Property="Template" Value="{StaticResource IconButtonControlTemplate}"/>
</Style>
Now you can go ahead and create icons and save them in your resource file:
<!-- Undo Icon -->
<Path x:Key="UndoIcon" Stretch="Fill" Data="F1 M 87.7743,80.7396L 87.5215,75.9539L 89.8692,74.2202C 89.9775,75.0329 90.0859,76.586 90.0859,76.5318C 92.9302,73.7417 97.5369,72.9755 100.208,76.2158C 102.019,78.413 102.258,81.2543 99.7657,83.9361C 97.2735,86.6179 92.6142,90.1124 92.6142,90.1124L 90.3748,87.6744L 97.3096,81.769C 97.3096,81.769 99.1516,79.9992 97.8514,78.3558C 96.2374,76.316 94.384,77.2542 92.1447,78.8795C 92.1176,78.9608 93.3998,79.1143 94.3118,79.2768L 92.4336,81.4439L 87.7743,80.7396 Z "/>
<!-- Filter Icon -->
<Path x:Key="FilterIcon" Stretch="Fill" Data="F1 M 6,16L 10,16L 10.0208,10L 16,3L 16,2.86102e-006L 0,9.53674e-007L 0,3L 6,10L 6,16 Z "/>
And finally, create buttons:
<usercontrols:IconButton IconPath="{StaticResource UndoIcon}"></usercontrols:IconButton>
The Path Data property is simply a Geometry. When you say "several such buttons" one assumes that there are a finite number of such buttons which vary with Icon.
Store each "Icon" as a PathGeomerty in a ResourceDictionaryand have that ResourceDictionary referenced as a merged dictionary in the app.xaml.
Now you can simply assign the geomerty into the Path shap Data property.
For the second part of the problem above, here's a kludge which works pretty well for storing string Path data as resources and accessing them from code.
For the first part of the problem, I just created all the animations in code, apply them on mouse events, got rid of the XAML page altogether.
This ship may have long since sailed, but I needed something very similar and was able to roll my own by inheriting from Button:
public class PathButton : Button
{
public static readonly DependencyProperty PathDataProperty =
DependencyProperty.Register("PathData", typeof(Geometry), typeof(PathButton), new PropertyMetadata(default(Geometry)));
public Geometry PathData
{
get { return (Geometry) GetValue(PathDataProperty); }
set { SetValue(PathDataProperty, value); }
}
}
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.1"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Duration="0" To="{StaticResource BlueColor}" Storyboard.TargetProperty="Color" Storyboard.TargetName="BackgroundRectangleColor" />
<ColorAnimation Duration="0" To="{StaticResource WhiteColor}" Storyboard.TargetProperty="Color" Storyboard.TargetName="IconColor" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed"/>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Unfocused"/>
<VisualState x:Name="Focused"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.Projection>
<PlaneProjection/>
</Grid.Projection>
<Rectangle x:Name="BackgroundRectangle" >
<Rectangle.Fill>
<SolidColorBrush x:Name="BackgroundRectangleColor" Color="{StaticResource GrayColor}" />
</Rectangle.Fill>
</Rectangle>
<Path x:Name="Icon" Stretch="Fill"
Data="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PathData}"
UseLayoutRounding="False" Grid.Column="1" Width="24" Height="24" VerticalAlignment="Center" Margin="0">
<Path.Fill>
<SolidColorBrush x:Name="IconColor" Color="{StaticResource LightGrayColor}" />
</Path.Fill>
</Path>
<TextBlock x:Name="Text" HorizontalAlignment="Center" TextWrapping="Wrap" Text="{TemplateBinding Content}" FontSize="9.333" FontFamily="Segoe UI Light" Foreground="{StaticResource LightGray}" Height="11" Margin="0,0,0,3" VerticalAlignment="Bottom"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Example usage:
<Controls:PathButton Content="Options" PathData="F1M50.6954,32.1146C50.7057,31.1041,50.6068,30.1107,50.4583,29.1459L54.5052,25.9193C53.4636,22.0377,51.4583,18.5612,48.7409,15.7604L43.9063,17.5885C42.3776,16.3229,40.6407,15.3099,38.7552,14.5814L37.9857,9.47656C36.1237,8.98181 34.1719,8.68225 32.1511,8.66663 30.1302,8.65625 28.1771,8.92578 26.2995,9.39844L25.4714,14.4948C23.5794,15.2057,21.8229,16.1901,20.2813,17.4401L15.4675,15.5521C12.7201,18.3138,10.6706,21.7631,9.57556,25.6328L13.582,28.9088C13.4193,29.875 13.3164,30.8658 13.3047,31.8776 13.2969,32.8984 13.3945,33.8854 13.5469,34.8588L9.49353,38.0807C10.5417,41.9584,12.5469,45.4401,15.2604,48.2383L20.0938,46.4127C21.6224,47.6744,23.3659,48.6875,25.2513,49.4193L26.0091,54.5234C27.8802,55.0209 29.8333,55.3177 31.8503,55.3334 33.8698,55.3385 35.8243,55.0729 37.6979,54.6041L38.5352,49.5C40.4219,48.7916,42.1784,47.806,43.7253,46.5664L48.53,48.4531C51.2813,45.6836,53.3268,42.233,54.4245,38.3685L50.418,35.0963C50.5833,34.1224,50.6862,33.1354,50.6954,32.1146 M31.9362,41.6615C26.6068,41.6302 22.3073,37.2734 22.3411,31.9375 22.3776,26.6002 26.7266,22.3008 32.0651,22.3359 37.4011,22.3698 41.7005,26.7252 41.6653,32.0625 41.629,37.4023 37.2786,41.6979 31.9362,41.6615"
Style="{StaticResource PathButtonStyle1}" Grid.RowSpan="2" Grid.Column="1" />

Stucked with Getting null values in iReport, JasperReports, Struts 2 plugin

I am using JasperReports and Struts2 to make to make some reports in my web application .
I am doing all this stuff with NetBeans IDE and iReport 3.5.1 plugin for designing purpose.
I am configuring my struts2-jasperreports plugin by following xml code.
<package name="jasper1" extends="jasperreports-default,struts-default">
<result-types>
<result-type name="jasper" class="org.apache.struts2.views.jasperreports.JasperReportsResult"/>
</result-types>
<action name="myJasperTest" class="testJasperAccountAction">
<result name="success" type="jasper">
<param name="location">/reports/account.jasper</param>
<param name="dataSource">accounts</param>
<param name="format">PDF</param>
</result>
<result name="error" type="jasper">/error.jsp</result>
</action>
</package>
My action class is as follows.
public class JasperAccountAction extends ActionSupport {
private IAccountSecurityProcessor accountSecurityProcessor;
private static ArrayList<Account> accounts;
public void setAccounts(ArrayList<Account> accounts) {
JasperAccountAction.accounts = accounts;
}
#Override
public String execute() throws Exception {
return SUCCESS;
}
public void setAccountSecurityProcessor(IAccountSecurityProcessor accountSecurityProcessor) {
this.accountSecurityProcessor = accountSecurityProcessor;
}
public ArrayList<Account> getAccounts() throws Exception {
try {
accounts = (ArrayList<Account>) this.accountSecurityProcessor.findByAll(0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, false, null, null, null, null, 0);
JasperCompileManager.compileReportToFile("E:\\Final_copy_of_erp\\SufalamERP\\build\\web\\reports\\account.jrxml", "E:\\Final_copy_of_erp\\SufalamERP\\build\\web\\reports\\account.jasper");
System.out.println("*******************************Accounts list for japser = =" + accounts + " ****************************************");
} catch (SufalamException ex) {
ex.printStackTrace();
System.out.println("*******************************Exception in sufalam ==>" + ex);
Logger.getLogger(JasperAccountAction.class.getName()).log(Level.SEVERE, null, ex);
}
return accounts;
}
}
my jasper report is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="null" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<queryString language="SQL">
<![CDATA[SELECT
account_master."id" AS account_master_id,
account_master."name" AS account_master_name
FROM
"public"."account_master" account_master]]>
</queryString>
<field name="account_master_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="account_master_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<group name="account_master_id">
<groupExpression><![CDATA[$F{account_master_id}]]></groupExpression>
<groupHeader>
<band height="27">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="139" height="27" forecolor="#FFFFFF" backcolor="#000000"/>
<textElement>
<font size="18"/>
</textElement>
<text><![CDATA[account_master_id]]></text>
</staticText>
<textField>
<reportElement mode="Opaque" x="139" y="0" width="416" height="27" forecolor="#FFFFFF" backcolor="#000000"/>
<textElement>
<font size="18" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Integer"><![CDATA[$F{account_master_id}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
<groupFooter>
<band height="8">
<line direction="BottomUp">
<reportElement key="line" x="1" y="4" width="554" height="1"/>
</line>
</band>
</groupFooter>
</group>
<background>
<band/>
</background>
<title>
<band height="58">
<line>
<reportElement x="0" y="8" width="555" height="1"/>
</line>
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/>
</line>
<staticText>
<reportElement x="65" y="13" width="424" height="35"/>
<textElement textAlignment="Center">
<font size="26" isBold="true"/>
</textElement>
<text><![CDATA[Classic template]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band/>
</pageHeader>
<columnHeader>
<band/>
</columnHeader>
<detail>
<band height="20">
<staticText>
<reportElement x="0" y="0" width="139" height="20"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[account_master_name]]></text>
</staticText>
<textField>
<reportElement x="139" y="0" width="416" height="20"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{account_master_name}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band/>
</columnFooter>
<pageFooter>
<band height="26">
<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
<reportElement key="textField" x="516" y="6" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField" x="342" y="6" width="170" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Right">
<font size="10"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField" x="1" y="6" width="209" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band/>
</summary>
</jasperReport>
and i using following jars in my project.
asm.jar
cglib.jar
commons-fileupload-1.2.1.jar
displaytag-export-poi-1.2.jar
hibernate3.jar
jasperreports-3.0.0.jar
org.apache.commons.logging_1.0.4.jar
struts2-core-2.0.11.1.jar
tiles-core-2.1.2.jar
xwork-2.1.2.jar
batik-dom.jar
batik-svg-dom.jar
groovy-all-1.5.5.jar
jaxen-1.1.1.jar
jxl-2.6.jar
rhino-1.7R1.jar
commons-lang-2.3.jar
displaytag-portlet-1.2.jar
hibernate-annotations.jar
jdt-compiler-3.1.1.jar
postgresql-8.3-603.jdbc3.jar
struts2-jasperreports-plugin-2.0.11.1.jar
tiles-jsp-2.1.2.jar
batik-anim.jar
batik-ext.jar
batik-svggen.jar
jakarta-bcel-20050813.jar
jcommon-1.0.15.jar
kxml2-2.3.0.jar
xalan.jar
commons-beanutils-1.7.0.jar
commons-logging-1.0.4.jar
dom4j.jar
hibernate-commons-annotations.jar
jta.jar
slf4j-api.jar
struts2-spring-plugin-2.0.11.1.jar
tiles-portlet-2.1.2.jar
batik-awt-util.jar
batik-gvt.jar
batik-util.jar
jasperreports-chart-themes-3.5.1.jar
xml-apis-ext.jar
kxml2-min-2.3.0.jar
xercesImpl.jar
commons-collections.jar
commons-logging-api-1.1.jar
ejb3-persistence.jar
hibernate-core.jar
log4j.jar
slf4j-log4j12.jar
struts2-tiles-plugin-2.1.6.jar
tiles-servlet-2.1.2.jar
batik-bridge.jar
batik-parser.jar
batik-xml.jar
jasperreports-dejavu-fonts.jar
jfreechart-1.0.0.jar
png-encoder-1.5.jar
commons-digester-1.8.1.jar
displaytag-1.2.jar
freemarker-2.3.8.jar
itext-1.3.1.jar
ognl-2.6.11.jar
spring.jar
tiles-api-2.1.2.jar
xwork-2.0.4.jar
batik-css.jar
batik-script.jar
castor-1.2.jar
JasperReportViewer.jar
jfreechart-1.0.12.jar
poi-3.2-FINAL-20081019.jar
an i am getting the following error.
2009-05-29 12:38:58,078 ERROR (org.apache.commons.digester.Digester:1646) - Parse Error at line 2 column 387: Document root element "jasperReport", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "jasperReport", must match DOCTYPE root "null".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1621)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1900)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:764)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1316)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3095)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:921)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.commons.digester.Digester.parse(Digester.java:1764)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:115)
at com.sufalam.presentation.finance.action.JasperAccountAction.getAccounts(JasperAccountAction.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:517)
at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:931)
at ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:53)
at ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:121)
at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.getProperty(OgnlValueStack.java:58)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
at com.opensymphony.xwork2.util.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:101)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
at ognl.ASTProperty.getValueBody(ASTProperty.java:92)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.Ognl.getValue(Ognl.java:333)
at ognl.Ognl.getValue(Ognl.java:310)
at com.opensymphony.xwork2.util.OgnlUtil.getValue(OgnlUtil.java:190)
at com.opensymphony.xwork2.util.OgnlValueStack.findValue(OgnlValueStack.java:208)
at org.apache.struts2.views.jasperreports.ValueStackDataSource.<init>(ValueStackDataSource.java:59)
at org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:204)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.ap
ache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(Def
aultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
2009-05-29 12:38:58,078 WARN (com.opensymphony.xwork2.util.OgnlValueStack:269) - Caught an exception while evaluating expression 'accounts' against value stack
Caught an Ognl exception while getting property accounts - Class: ognl.OgnlRuntime
File: OgnlRuntime.java
Method: getMethodValue
Line: 935 - ognl/OgnlRuntime.java:935:-1
at com.opensymphony.xwork2.util.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:106)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
at ognl.ASTProperty.getValueBody(ASTProperty.java:92)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
Looks like your JasperReport.xml is simply missing a doctype. Try starting the file this way:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="null" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
the field names shold be similar to the account bean's property names
I was facing the same problem, I could fix it just putting the correct field name from my bean
<fieldDescription><![CDATA[correct_name_of_field]]></fieldDescription>, of course in your .jrxml ;)
I was on it for a couple of days.
By the way put all the jars of jasper, apache commons*, poi, itext, jxl.

Resources