croutledge Posted May 6, 2009 Share Posted May 6, 2009 I have created a JavaBeans set datasource to load some test data so i can preview my report in iReport. But if i amend the code in the Java Class it will only show the new data in the Preview in iReport if i close iReport and start it up again. Is there any way to get around this?No matter how many times i click refresh it won't pull the new data in. Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted May 6, 2009 Share Posted May 6, 2009 Be sure the class is in a jar or path set as "reloadable", otherwise your class will be loaded in memory only the first time you execute a report.Giulio Link to comment Share on other sites More sharing options...
croutledge Posted May 7, 2009 Author Share Posted May 7, 2009 I have included the folder to the class in the classpath and set it to reloadable and it still won't refresh the data until i close iReport and start again. Does it need to be in a jar file? I find it easier to add the folder the java project is in, into the classpath so i don't always have to export it to a jar. Cheers Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted May 7, 2009 Share Posted May 7, 2009 My favorite way is actually to create a jar all the times (NetBeans actually does it for me when I build the project...so for me it's easier).But I'm not sure this is the problem... it could be, do you mind to try it?Thanks a lot!Giulio Link to comment Share on other sites More sharing options...
croutledge Posted May 8, 2009 Author Share Posted May 8, 2009 Giulio, Just tried it with a jar file and the refresh works just fine that way. So i created a jar, previewed the report. Changed the Java code to a new value, created the jar and refreshed the preview and it was updated. Would be handy to have this work with a folder as i'm using RAD and i wouldn't normaly create a JAR file. Thanks for help Carl Link to comment Share on other sites More sharing options...
croutledge Posted May 11, 2009 Author Share Posted May 11, 2009 Any response to my question around just having the folder in the classpath not a jar? Link to comment Share on other sites More sharing options...
dman Posted May 12, 2009 Share Posted May 12, 2009 hm, no idea. I use scriptlets and a JRBeanCollectionDataSource as data source expr. for my subreport. All my reports and scriptlets (in a subdir) are in folders, i.e. I don't use jars at all and everything works fine.regards,dman Link to comment Share on other sites More sharing options...
croutledge Posted May 12, 2009 Author Share Posted May 12, 2009 Hmm, indeed.I have them in the classpath and set to reloadable. I suppose i will just fight on with it as it is.CheersCarl Link to comment Share on other sites More sharing options...
pjacobsma Posted June 30, 2011 Share Posted June 30, 2011 I have found a way to get iReport to refresh the datasource using a classpath folder. After you change the dataprovider class and re-compile it, go to the Connections/Datasources dialog by clicking the button to the left of the datasource dropdown. Select the datasource you are using and click the Modify button. Then just click the Save button. This will refresh the memory copy of the datasource class.It would be really nice if the Preview function would just reload the class automatically. 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