Re: cayenne+jasperreports problem

From: Cris Daniluk (cris.danilu..mail.com)
Date: Thu May 11 2006 - 09:02:13 EDT

  • Next message: Tomi NA: "a...bug with pgsql and addPrefetch? (Cay 1.2B2)"

    FYI, this was written for Jasper 1.1. 1.2 has some significant changes
    that probably lead to an easier way to do integration w/Cayenne. I
    have no idea if this works with 1.2 or not.

    Cris

    On 5/11/06, Alan Baltazar <acatalan..ahoo.com> wrote:
    > hello,
    >
    > i implemented this
    > http://www.objectstyle.org/confluence/display/CAY/Jasper+Integration
    > 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)rowIterator.next(); <--- 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) rowIterator.next();
    > }
    >
    > 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.
    >
    > Alan,
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Tired of spam? Yahoo! Mail has the best spam protection around
    > http://mail.yahoo.com
    >



    This archive was generated by hypermail 2.0.0 : Thu May 11 2006 - 09:03:43 EDT