Guest User

Untitled

a guest
Jan 21st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.94 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 -->
  3. <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="main" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="6a63a79b-6f04-46c7-b3b9-a067e835ea4d">
  4. <parameter name="subRptTitle" class="java.lang.String"/>
  5. <parameter name="statsData1" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
  6. <background>
  7. <band splitType="Stretch"/>
  8. </background>
  9. <title>
  10. <band height="79" splitType="Stretch">
  11. <textField>
  12. <reportElement x="250" y="20" width="100" height="30" uuid="42f86896-5b37-4ee3-8f0c-29bf90eb3846"/>
  13. <textFieldExpression><![CDATA[$P{subRptTitle}]]></textFieldExpression>
  14. </textField>
  15. </band>
  16. </title>
  17. <summary>
  18. <band height="203" splitType="Stretch">
  19. <subreport>
  20. <reportElement x="10" y="31" width="281" height="161" uuid="73d60b1f-1b66-44b1-a8a5-d9738067aaf1"/>
  21. <subreportParameter name="statsData">
  22. <subreportParameterExpression><![CDATA[$P{statsData1}]]></subreportParameterExpression>
  23. </subreportParameter>
  24. <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>
  25. <subreportExpression><![CDATA["sub-table.jasper"]]></subreportExpression>
  26. </subreport>
  27. <subreport>
  28. <reportElement x="310" y="31" width="273" height="161" uuid="686bb10d-7018-4cf1-b72b-c17e534ec5e0"/>
  29. <subreportParameter name="statsData">
  30. <subreportParameterExpression><![CDATA[$P{statsData1}]]></subreportParameterExpression>
  31. </subreportParameter>
  32. <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>
  33. <subreportExpression><![CDATA["sub-table.jasper"]]></subreportExpression>
  34. </subreport>
  35. </band>
  36. </summary>
  37. </jasperReport>
  38.  
  39. <?xml version="1.0" encoding="UTF-8"?>
  40. <!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 -->
  41. <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="main" pageWidth="200" pageHeight="842" columnWidth="200" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="6a63a79b-6f04-46c7-b3b9-a067e835ea4d">
  42. <style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
  43. <box>
  44. <pen lineWidth="0.5" lineColor="#000000"/>
  45. <topPen lineWidth="0.5" lineColor="#000000"/>
  46. <leftPen lineWidth="0.5" lineColor="#000000"/>
  47. <bottomPen lineWidth="0.5" lineColor="#000000"/>
  48. <rightPen lineWidth="0.5" lineColor="#000000"/>
  49. </box>
  50. </style>
  51. <style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
  52. <box>
  53. <pen lineWidth="0.5" lineColor="#000000"/>
  54. <topPen lineWidth="0.5" lineColor="#000000"/>
  55. <leftPen lineWidth="0.5" lineColor="#000000"/>
  56. <bottomPen lineWidth="0.5" lineColor="#000000"/>
  57. <rightPen lineWidth="0.5" lineColor="#000000"/>
  58. </box>
  59. </style>
  60. <style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
  61. <box>
  62. <pen lineWidth="0.5" lineColor="#000000"/>
  63. <topPen lineWidth="0.5" lineColor="#000000"/>
  64. <leftPen lineWidth="0.5" lineColor="#000000"/>
  65. <bottomPen lineWidth="0.5" lineColor="#000000"/>
  66. <rightPen lineWidth="0.5" lineColor="#000000"/>
  67. </box>
  68. <conditionalStyle>
  69. <conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
  70. <style backcolor="#FBFDFF"/>
  71. </conditionalStyle>
  72. </style>
  73. <subDataset name="tableDataSet" uuid="2914f7c6-c2d7-448b-b0c1-090970e18ed6">
  74. <field name="subEntity" class="java.lang.String"/>
  75. <field name="total" class="java.lang.Double"/>
  76. <field name="pending" class="java.lang.Double"/>
  77. <field name="percentage" class="java.lang.Double"/>
  78. <variable name="vTotalSum" class="java.lang.Double" calculation="Sum">
  79. <variableExpression><![CDATA[$F{total}]]></variableExpression>
  80. </variable>
  81. <variable name="vPendingSum" class="java.lang.Double" calculation="Sum">
  82. <variableExpression><![CDATA[$F{pending}]]></variableExpression>
  83. </variable>
  84. <variable name="vPercentageSum" class="java.lang.Double" calculation="Sum">
  85. <variableExpression><![CDATA[$F{percentage}]]></variableExpression>
  86. </variable>
  87. </subDataset>
  88. <parameter name="subRptTitle" class="java.lang.String"/>
  89. <parameter name="statsData" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
  90. <background>
  91. <band splitType="Stretch"/>
  92. </background>
  93. <title>
  94. <band height="79" splitType="Stretch">
  95. <textField>
  96. <reportElement x="50" y="30" width="100" height="30" uuid="42f86896-5b37-4ee3-8f0c-29bf90eb3846"/>
  97. <textFieldExpression><![CDATA[$P{subRptTitle}]]></textFieldExpression>
  98. </textField>
  99. </band>
  100. </title>
  101. <summary>
  102. <band height="203" splitType="Stretch">
  103. <componentElement>
  104. <reportElement x="9" y="11" width="182" height="181" uuid="7451c7aa-8532-471e-ad02-eb98ca21d171">
  105. <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
  106. <property name="com.jaspersoft.studio.table.style.table_header" value="Table_TH"/>
  107. <property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/>
  108. <property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/>
  109. </reportElement>
  110. <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
  111. <datasetRun subDataset="tableDataSet" uuid="eecbe24c-593f-42fa-a7ab-2fbe8b59cb34">
  112. <dataSourceExpression><![CDATA[$P{statsData}]]></dataSourceExpression>
  113. </datasetRun>
  114. <jr:column width="45" uuid="6ea97833-5ba6-48f1-9096-66bb2d6d5978">
  115. <jr:tableHeader style="Table_TH" height="30"/>
  116. <jr:tableFooter style="Table_TH" height="30"/>
  117. <jr:columnHeader style="Table_CH" height="30">
  118. <staticText>
  119. <reportElement x="0" y="0" width="45" height="30" uuid="afce87c3-7a33-4b79-9627-2c2f37d78609"/>
  120. <text><![CDATA[subEntity]]></text>
  121. </staticText>
  122. </jr:columnHeader>
  123. <jr:columnFooter style="Table_CH" height="30"/>
  124. <jr:detailCell style="Table_TD" height="30">
  125. <textField>
  126. <reportElement x="0" y="0" width="45" height="30" uuid="f312e4dc-bd65-4cf6-8c2c-27c1d88940b9"/>
  127. <textFieldExpression><![CDATA[$F{subEntity}]]></textFieldExpression>
  128. </textField>
  129. </jr:detailCell>
  130. </jr:column>
  131. <jr:column width="45" uuid="89672e7b-ee57-4a0d-8f6e-885c189a9c1d">
  132. <jr:tableHeader style="Table_TH" height="30"/>
  133. <jr:tableFooter style="Table_TH" height="30">
  134. <textField>
  135. <reportElement x="0" y="0" width="45" height="30" uuid="c8ef39c5-ea48-41e4-a069-9d07e1ce301b"/>
  136. <textFieldExpression><![CDATA[$V{vTotalSum}]]></textFieldExpression>
  137. </textField>
  138. </jr:tableFooter>
  139. <jr:columnHeader style="Table_CH" height="30">
  140. <staticText>
  141. <reportElement x="0" y="0" width="45" height="30" uuid="c57bbc8c-b840-45fd-b21a-3b7121c29f71"/>
  142. <text><![CDATA[total]]></text>
  143. </staticText>
  144. </jr:columnHeader>
  145. <jr:columnFooter style="Table_CH" height="30"/>
  146. <jr:detailCell style="Table_TD" height="30">
  147. <textField>
  148. <reportElement x="0" y="0" width="45" height="30" uuid="bf1068c6-42f2-4cb4-b1f0-8b195d362247"/>
  149. <textFieldExpression><![CDATA[$F{total}]]></textFieldExpression>
  150. </textField>
  151. </jr:detailCell>
  152. </jr:column>
  153. <jr:column width="45" uuid="4b3eea40-3cca-48a8-961f-6fbe9edfb973">
  154. <jr:tableHeader style="Table_TH" height="30"/>
  155. <jr:tableFooter style="Table_TH" height="30">
  156. <textField>
  157. <reportElement x="0" y="0" width="45" height="30" uuid="f4787fdd-5f5b-4f03-97e7-05e4c2c34f0f"/>
  158. <textFieldExpression><![CDATA[$V{vPendingSum}]]></textFieldExpression>
  159. </textField>
  160. </jr:tableFooter>
  161. <jr:columnHeader style="Table_CH" height="30">
  162. <staticText>
  163. <reportElement x="0" y="0" width="45" height="30" uuid="5aa2afde-3b32-480e-b115-9ffddf95ab64"/>
  164. <text><![CDATA[pending]]></text>
  165. </staticText>
  166. </jr:columnHeader>
  167. <jr:columnFooter style="Table_CH" height="30"/>
  168. <jr:detailCell style="Table_TD" height="30">
  169. <textField>
  170. <reportElement x="0" y="0" width="45" height="30" uuid="89a528bc-2e09-467f-b709-7434bc6732da"/>
  171. <textFieldExpression><![CDATA[$F{pending}]]></textFieldExpression>
  172. </textField>
  173. </jr:detailCell>
  174. </jr:column>
  175. <jr:column width="45" uuid="a7c26c8f-361f-4d33-820a-abd2cb3268ad">
  176. <jr:tableHeader style="Table_TH" height="30"/>
  177. <jr:tableFooter style="Table_TH" height="30">
  178. <textField>
  179. <reportElement x="0" y="0" width="45" height="30" uuid="7e1115c0-35fb-48d2-b0bd-b36e5a782d67"/>
  180. <textFieldExpression><![CDATA[$V{vPercentageSum}]]></textFieldExpression>
  181. </textField>
  182. </jr:tableFooter>
  183. <jr:columnHeader style="Table_CH" height="30">
  184. <staticText>
  185. <reportElement x="0" y="0" width="45" height="30" uuid="20743d33-811c-411a-b7d1-c78e57ccd018"/>
  186. <text><![CDATA[percentage]]></text>
  187. </staticText>
  188. </jr:columnHeader>
  189. <jr:columnFooter style="Table_CH" height="30"/>
  190. <jr:detailCell style="Table_TD" height="30">
  191. <textField>
  192. <reportElement x="0" y="0" width="45" height="30" uuid="ebeb9419-af5d-4475-a8f7-ab13ab4a7b9f"/>
  193. <textFieldExpression><![CDATA[$F{percentage}]]></textFieldExpression>
  194. </textField>
  195. </jr:detailCell>
  196. </jr:column>
  197. </jr:table>
  198. </componentElement>
  199. </band>
  200. </summary>
  201. </jasperReport>
  202.  
  203. List<BasicStats> summaryList = new ArrayList<>();
  204. summaryList.add(new BasicStats("A", 5d, 6.5d, 25d));
  205. summaryList.add(new BasicStats("B", 1.47d, 2.7d, 72d));
  206. summaryList.add(new BasicStats("c", .39d, 9.5d, 91d));
  207. summaryList.add(new BasicStats("D", 8.2d, 1.3d, 37d));
  208. summaryList.add(new BasicStats("E", 6.8d, 4.5d, 19d));
  209.  
  210. Map<String, Object> paramsMap = new HashMap<>();
  211. JRBeanCollectionDataSource jbcdSummary = new JRBeanCollectionDataSource(summaryList);
  212. paramsMap.put("statsData1", jbcdSummary);
  213.  
  214. paramsMap.put("statsData1", new JRBeanCollectionDataSource(summaryList));
  215. paramsMap.put("statsData2", new JRBeanCollectionDataSource(summaryList));
  216.  
  217. <parameter name="statsData1" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
  218. <parameter name="statsData2" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
  219. <subreport>
  220. <reportElement x="310" y="31" width="273" height="161" uuid="686bb10d-7018-4cf1-b72b-c17e534ec5e0"/>
  221. <subreportParameter name="statsData">
  222. <subreportParameterExpression><![CDATA[$P{statsData2}]]></subreportParameterExpression>
  223. </subreportParameter>
  224. <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>
  225. <subreportExpression><![CDATA["sub-table.jasper"]]></subreportExpression>
  226. </subreport>
  227.  
  228. <parameter name="statsData1" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
  229. <parameter name="statsData2" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
  230. <subreport>
  231. <reportElement x="310" y="31" width="273" height="161" uuid="686bb10d-7018-4cf1-b72b-c17e534ec5e0"/>
  232. <subreportParameter name="statsData">
  233. <subreportParameterExpression><![CDATA[$P{statsData2}]]></subreportParameterExpression>
  234. </subreportParameter>
  235. <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>
  236. <subreportExpression><![CDATA["sub-table.jasper"]]></subreportExpression>
  237. </subreport>
  238.  
  239. paramsMap.put("statsData", summaryList);
  240.  
  241. <parameter name="statsData" class="java.util.List"/>
  242. ...
  243. <subreportParameter name="statsData">
  244. <subreportParameterExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{statsData})]]></subreportParameterExpression>
  245. </subreportParameter>
  246. ...
Add Comment
Please, Sign In to add comment