Open jackal390iv opened 10 years ago
however I don't see an easy way to do selective prints outside of the jtable (why would you want to anyways...)
yes this should work fine. Take a look in here. You should be able to use that JTable. The GUI code has been untested for a while, though, so may experience some difficulties.
I could also combine 2/3 of the printing classes if you want (like you asked me about earlier) However there may be large empty gaps in the prints (unused variables) and I'm unsure if jasperreports is even capable of that without erroring out from missing TitleText's
I tried to combine the jtable's before and it glitched/errored out but I'm unsure if regular parameters handle the same way...
if you want to do it quickly, you should be able to use just the stuff in here.
You could do something like:
// setup
BeanTableModelFactory btf;
btf = new BeanTableModelFactory(new BeanUtilsBean());
btf.registerConverter(new CustomMoneyConverter(), CustomMoney.class);
btf.registerConverter(new InstantConverter(), Instant.class);
// actual code starts here
BeanTableModel btm = btf.get(Driver.class);
Collection<Driver> drivers = new ArrayList<>();
/* add stuff to collection */
btm.setResources(drivers)
JTable mytbl = new JTable();
mytbl.setModel(btm);
/* process JTable to Jasper */
best way i can think to do selected jtable printing is to create a new jtable based on the users selection/highlight, then send the new jtable to ReportPrinter when the call is made (instead of sending the whole jtable) using a simple if/else statement.