cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: cayenne+jasperreports problem
Date Thu, 11 May 2006 09:42:07 GMT
Alan, did you make sure that the list you hand in contains DataRows? e.g. used SQLTemplate
to create the list  and set to return DataRows?

Alan Baltazar <> wrote:

  i implemented this
to integrate cayenne and jasperreports for a web application (no spring framework, just
straight cayenne,struts web app). my problem here, is that, I get a class cast exception
for this class, DataRowDataSource (see arrow below).

public class DataRowDataSource implements JRDataSource {

    private Iterator rowIterator;
    private DataRow activeRow;
    public DataRowDataSource(List dataRowList) {
        rowIterator = dataRowList.iterator();
        activeRow = (DataRow);  <--- cast problem here (posted sample
                                                    didn't have the (DataRow) cast, i
added                                                    it here to compile)

    public boolean next() throws JRException {
        boolean hasNext = rowIterator.hasNext();
        if (hasNext) {
            activeRow = (DataRow);
        return hasNext;

    public Object getFieldValue(JRField field) throws JRException {
        return activeRow.get(field.getName());


 has anyone implemented this sample? if yes, how did you fix this problem? I'm using the
latest cayenne, struts, jasperreports versions.


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around

 sent via WebmailLight 3.1.9

View raw message