Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

How to fill data into a table in a prpt file using java

$
0
0
I have created a prpt file that contains a table using report designer.I referred Will Gorman's book 'Pentaho reporting for Java developers'.I have parsed the prpt file and am trying to fill data from a query into this table using java.I am able to generate an empty pdf.Below is the code snippet :
Code:

TypedTableModel ttm=newTypedTableModel(newString[]{"Date","Duration"});
   
while(res.next()){
    ttm
.addRow(newObject[]{res.getDate("date"),res.getLong("duration")});
   
}


This did not work.What is the correct way to populate an existing table?The prpt file already contains the basic outline of the table but filling the data in the table has to be done using java API.

The table is is in the format shown below :
Date | Duration (ms)


I want to fill dates below 'Date' label and durations below 'Duration ' label.

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>