Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use data from JTable for my Jasper report

I'm new in using Jasper and I'm practicing of creating programs for accounting. Jasper helps me to generate nice reports using SQL queries, but is there a any way to generate report using data's from jtable? Thank you!

like image 368
Branislav Lazic Avatar asked Jun 13 '12 15:06

Branislav Lazic


1 Answers

Yes, you can build a JRDataSource from a table model using JRTableModelDataSource.

The names of the fields are the names of the columns returned by TableModel.getColumnNames(). You may also use COLUMN_<index> as field name.

like image 55
JB Nizet Avatar answered Dec 01 '22 01:12

JB Nizet