
I have 2 tables in one swing user interface. I want to view and get printed them in a jasper report. In the jasper report, the tables should be viewed seperately. I have done this when there is one table. I want to know do for two tables. (here I am sending two parameters as well. and this has been coded for a button action performed)
try{ JRTableModelDataSource datasource=new JRTableModelDataSource(jTable1.getModel()); String reportSource="C:/Program Files/AccsBook/Tools/DiscountInvoice.jrxml"; //"C:/Program Files/AccsBook/Tools" // the jrxml file Map<String,Object>params=new HashMap<String,Object>();
params.put("NoItm", jTextField1.getText());
params.put("Am", jTextField2.getText());
JasperReport jasperReport=JasperCompileManager.compileReport(reportSource);
JasperPrint jasperPrint=JasperFillManager.fillReport(jasperReport, params,datasource);
JasperViewer.viewReport(jasperPrint,false);
JRViewer j=new JRViewer(jasperPrint);
//jTabbedPane1.add("Customer Details",j);
}catch(JRException jRException){ }
Is there any one knows please answer........
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.