JTable content and database table in one report

I am new to JasprReports. I learned how to get JTable content in JasperReport using

JasperFillManager.fillReport(jasperReport, new HashMap(), new JRTableModelDataSource(table.getModel()));

and get the contents of Oracle SQL into the report using

JasperFillManager.fillReport(jasperReport, new HashMap(), connection);

My question is: is it possible to get both of them in one report?

For example, I have the contents of a JTable:

EMP_NO, EMP_NAME, EMP_SALARY

which is the main content of the table, and I want something in the header from the SQL table.

Department_no, Department_Name

Any ideas?

+3
source share
1 answer

Workaround detected ...

I get the contents of a table from a database in java using jdbc and then using hashmap params to pass this content for the report.

Got this idea from here .

0

Source: https://habr.com/ru/post/1775059/


All Articles