szy.ly Posted April 19, 2023 Posted April 19, 2023 Deal all Recently started learning Jasper Report, I have some doubts about data filling.Question 1Map<String, Object> parameter = new HashMap<>();parameter.put("my_title", "Hi, I am title");parameter.put("myBean", new MyBean());JasperPrint jasperPrint = JasperFillManager.fillReport(jasperDesign, parameter, new JREmptyDataSource());about this code ,I created parameters named "my_title" and class = java.lang.String with Jaspersoft Studio ps: <textFieldExpression><![CDATA[$P{my_title}]]></textFieldExpression>If I want to use javebean like jackson such as <textFieldExpression><![CDATA[$P{myBean.name}]]></textFieldExpression>What should I do ?
Solution olyncircle Posted April 21, 2023 Solution Posted April 21, 2023 Make your bean a field not a parameter.Instead of using new JREmptyDataSource(), you can use JRBeanCollectionDataSource.
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