Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
684 views
in Technique[技术] by (71.8m points)

java - 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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...