我可以使用JTable的数据作为我的Jasper报告 [英] Can I use data from JTable for my Jasper report
本文介绍了我可以使用JTable的数据作为我的Jasper报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是使用Jasper的新手,我正在练习创建会计程序。 Jasper帮助我使用SQL查询生成漂亮的报告,但有没有办法使用jtable中的数据生成报告?谢谢!
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!
推荐答案
是的,您可以使用 JRTableModelDataSource 。
字段的名称是 TableModel.getColumnNames()
返回的列的名称。您也可以使用 COLUMN_< index>
作为字段名称。
The names of the fields are the names of the columns returned by TableModel.getColumnNames()
. You may also use COLUMN_<index>
as field name.
这篇关于我可以使用JTable的数据作为我的Jasper报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文