Jak przekazać Listę JRBeanCollectionDataSource do podraportu

Generuję raport z JRBeanCollectionDataSource. Ten raport dotyczy zamówienia klienta.

To jest mój kod

public class Customer
{
    private String customerName;
    private String customerNo;
    private String customerAddress;
    private ArrayList<CustomerOrder> customerOrders;
    //Getters and Setters
}


private class CustomerOrder
{
    private String itemName;
    private BigDecimal amount;
    private int itemQuantity;
    //Getters and Setters
}

Kiedy klient musi wygenerować raport zawierający dane klienta i listę zamówień klienta. OdJRBeanCollectionDataSource bierze kolekcję, to właśnie zrobiłem.

Customer cust; //Customer Instance

ArrayList<Customer> custList = new ArrayList<Customer>();
custList.add(cust); 

JRBeanCollectionDataSource rptData = new JRBeanCollectionDataSource(custList);

Jak mogę wyodrębnićCustomerOrder lista wCustomer i przekazać to jako podraport?

questionAnswers(1)

yourAnswerToTheQuestion