swapnilnagtilak722 Posted June 12, 2020 Share Posted June 12, 2020 I'm using JRBeanDataSource and that's why child table field is unable to fetchIt can be fetched using query in JasperSoftStudio but programatically it is giving error : net.sf.jasperreports.engine.JRException: Error retrieving field value from bean: fullname.Query is as following :select ordrs.voucher, ordrs.advance, ordrs.due, clnt.fullname, prdct.cost, prdct.namefrom orders ordrs inner join client clnt on ordrs.`client id` = clnt.idinner join product prdct on ordrs.`product id` = prdct.id where ordrs.id = $P{id}But using following program it is cause of an error : List<Orders> orders = bLManager.searchOrder(Integer.parseInt(textField.getText())); Map map = new HashMap(); map.put("id", Integer.parseInt(textField.getText())); try { InputStream inputStream = getClass().getResourceAsStream("/com/clientie/reports/Receipt Voucher.jasper"); JRBeanCollectionDataSource jRBeanCollectionDataSource = new JRBeanCollectionDataSource(orders, false); JasperPrint jasperPrint = JasperFillManager.fillReport(inputStream, map, jRBeanCollectionDataSource); JasperViewer.viewReport(jasperPrint, false); } catch (JRException ex) { Logger.getLogger(NewOrderController.class.getName()).log(Level.SEVERE, null, ex); }So when in Order class field name fullname is not exist it's being cause of error. Do I need to change my query or I should use JDBC connection insted JRBeanCollectionDataSource?Using MySQL 8.0.20 JDK 11.0+10 and JasperReport 6.12.2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now