Re: cayenne+jasperreports problem

From: Alan Baltazar (acatalan..ahoo.com)
Date: Fri May 12 2006 - 03:50:14 EDT

  • Next message: Alan Baltazar: "Re: cayenne+jasperreports problem"

    DataRows seem to be the only solution i could think of to wrap the JRDataSource
    implementation, which is required by jasperreports to read the datasource data.
    JRDataSource is a wrapper hashmap for reading the rows from a datasource. i don't know
    much about dataobjects to implement this .... if you do, please let me know how.

    --- Juergen Saar <juerge..saar.org> wrote:

    > Why do you work on DataRows ... DataObjects are much more like
    > BusinessObjects.
    >
    > If you work on DataObjects and there are some getters for
    > transient informations coming from business-logic
    > it can help a lot.
    >
    > Just one more hint:
    > reading content of DataObjects with jxpath is really cool.
    >
    > 2006/5/11, Alan Baltazar <acatalan..ahoo.com>:
    > >
    > > 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 : Fri May 12 2006 - 03:50:41 EDT