neha_dhingra Posted April 11, 2008 Share Posted April 11, 2008 Hi Friends, How can we add or remove coloumns dynamically in Jasper Reports? thoughts? Thanks,Neha Link to comment Share on other sites More sharing options...
Aristide Posted April 14, 2008 Share Posted April 14, 2008 It's a little like adding JTextField on a JFrame in swing. The simpliest is to look at the example in "Demo" directory of JasperReport.See "demosamplesnoxmldesignNoXmlDesignApp.java" Examine the method :"private static JasperDesign getJasperDesign" especialy see some code like : Code:field = new JRDesignField();field.setName("FirstName"«»);field.setValueClass(java.lang.String.class);jasperDesign.addField(field); When you see the whole code, you understand that you have to get the section as desingsection, then construct a field as designfield and after add your field to the desing section. It takes time but it worth it regards Link to comment Share on other sites More sharing options...
neha_dhingra Posted April 15, 2008 Author Share Posted April 15, 2008 Thank You Aristide :) Link to comment Share on other sites More sharing options...
dnvsrikanth Posted April 15, 2008 Share Posted April 15, 2008 hi neha I dont know about the code given above, but for adding the field dynamically you need to use Velocity framework. Check the following link: http://www.ibm.com/developerworks/websphere/library/techarticles/0505_olivieri/0505_olivieri.html DNV Srikanth 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