使用子报告是唯一的解决方案吗?

时间:2014-09-19 09:19:37

标签: jasper-reports xmldatasource

我们正在使用Jasper Reports来构建我们的报告。有一份报告看起来有点像这样。

Rcpt No | Rcpt Date | Dealer Name | Items | Qty Ordered | Qty Received | Qty Accepted | Qty Rejected
====================================================================================================
1       | 12-08-14  | ABC Corp.   | 

                                  | Item1 | 30          | 30           | 30           | 0
                                  | Item2 | 30          | 30           | 30           | 0
                                  | Item3 | 30          | 30           | 30           | 0
                                  | Item4 | 30          | 30           | 30           | 0
----------------------------------------------------------------------------------------------------
1       | 12-08-14  | ABC Corp.   | 

                                  | Item1 | 30          | 30           | 30           | 0
                                  | Item2 | 30          | 30           | 30           | 0
                                  | Item3 | 30          | 30           | 30           | 0
                                  | Item4 | 30          | 30           | 30           | 0
----------------------------------------------------------------------------------------------------
1       | 12-08-14  | ABC Corp.   | 

                                  | Item1 | 30          | 30           | 30           | 0
                                  | Item2 | 30          | 30           | 30           | 0
                                  | Item3 | 30          | 30           | 30           | 0
                                  | Item4 | 30          | 30           | 30           | 0
----------------------------------------------------------------------------------------------------

我们使用xml作为报告的数据源。这是XML:

<?xml version="1.0" encoding="UTF-8"?>
<data>
   <period>
      <fromDate>someFromDate</fromDate>
      <toDate>someToDate greater than fromDate</toDate>
   </period>
   <receiptList>

         <someStoresInwardReceiptNumber>
            <_id>someMongoGivenId</_id>
            <challanNo>someChallanNumber</challanNo>
            <itemList>

                  <item>
                     <_id>someItemId</_id>
                     <description>someDescription</description>
                     <productCatlgNo>someProductCatalogNo</productCatlgNo>
                     <quantityInNumbers>
                        <acceptedQuantity>20</acceptedQuantity>
                        <declaredQuantity>20</declaredQuantity>
                        <receivedQuantity>20</receivedQuantity>
                        <rejectedQuantity>0</rejectedQuantity>
                        <units>pcs</units>
                     </quantityInNumbers>
                     <quantityinWeight>
                        <acceptedWeight>0</acceptedWeight>
                        <declaredWeight>0</declaredWeight>
                        <receivedWeight>0</receivedWeight>
                        <rejectedWeight>0</rejectedWeight>
                        <units null="true" />
                     </quantityinWeight>
                  </item> 
                  <item>
                     <_id>someItemId1</_id>
                     <description>someDescription1</description>
                     <productCatlgNo>someProductCatalogNo1</productCatlgNo>
                     <quantityInNumbers>
                        <acceptedQuantity>0</acceptedQuantity>
                        <declaredQuantity>0</declaredQuantity>
                        <receivedQuantity>0</receivedQuantity>
                        <rejectedQuantity>0</rejectedQuantity>
                        <units null="true" />
                     </quantityInNumbers>
                     <quantityinWeight>
                        <acceptedWeight>300</acceptedWeight>
                        <declaredWeight>300</declaredWeight>
                        <receivedWeight>300</receivedWeight>
                        <rejectedWeight>300</rejectedWeight>
                        <units>kgs</units>
                     </quantityinWeight>
                  </item>

            </itemList>
            <partyName>somePartyName</partyName>
            <receiptDate>someDate</receiptDate>
            <receiptNumber>someStoresInwardReceiptNumber</receiptNumber>
         </someStoresInwardReceiptNumber>

         <someOtherStoresInwardReceiptNumber>
            <_id>someMongoGivenId</_id>
            <challanNo>someChallanNumber</challanNo>
            <itemList>

                  <item>
                     <_id>someItemId</_id>
                     <description>someDescription</description>
                     <productCatlgNo>someProductCatalogNo</productCatlgNo>
                     <quantityInNumbers>
                        <acceptedQuantity>20</acceptedQuantity>
                        <declaredQuantity>20</declaredQuantity>
                        <receivedQuantity>20</receivedQuantity>
                        <rejectedQuantity>0</rejectedQuantity>
                        <units>pcs</units>
                     </quantityInNumbers>
                     <quantityinWeight>
                        <acceptedWeight>0</acceptedWeight>
                        <declaredWeight>0</declaredWeight>
                        <receivedWeight>0</receivedWeight>
                        <rejectedWeight>0</rejectedWeight>
                        <units null="true" />
                     </quantityinWeight>
                  </item>

                  <item>
                     <_id>someItemId1</_id>
                     <description>someDescription1</description>
                     <productCatlgNo>someProductCatalogNo1</productCatlgNo>
                     <quantityInNumbers>
                        <acceptedQuantity>0</acceptedQuantity>
                        <declaredQuantity>0</declaredQuantity>
                        <receivedQuantity>0</receivedQuantity>
                        <rejectedQuantity>0</rejectedQuantity>
                        <units null="true" />
                     </quantityInNumbers>
                     <quantityinWeight>
                        <acceptedWeight>300</acceptedWeight>
                        <declaredWeight>300</declaredWeight>
                        <receivedWeight>300</receivedWeight>
                        <rejectedWeight>300</rejectedWeight>
                        <units>kgs</units>
                     </quantityinWeight>
                  </item>

            </itemList>
            <partyName>somePartyName</partyName>
            <receiptDate>someDate</receiptDate>
            <receiptNumber>someOtherStoresInwardReceiptNumber</receiptNumber>
         </someOtherStoresInwardReceiptNumber>

   </receiptList>
</data>

使用子报表是创建此报告的唯一方法吗?还是有一种我们不知道的方式?

先谢谢。

1 个答案:

答案 0 :(得分:1)

我们可以通过Rcpt Date或经销商名称“分组”这些结果。

由于