joka83 Posted April 15, 2011 Share Posted April 15, 2011 hey guys, i got a few problems with using datasources in iReport. in my project I try to connect to a dms server, get the data, put it in a JRBeanCollectionDataSource and work with the data in iReport.in my eclipse project it already works to get the data, but whenever i try to establish this datasource in iReport it fails, saying "general problem: de.hsrm.mi.FirstTry.Search.search()" and i have no idea why :(the Java-Search-methode I wrote expects a session, a server and a factory (dms specific)...i instantiate the class from my main class and call the medod: "public static JRBeanCollectionDataSource search(ISession session, IDocumentServer server, ISerClassFactory factory) throws Exception {" this search method itself, returns "return new JRBeanCollectionDataSource(collection);" "collection" is a List of Databeans: "List<DataBean> collection = new ArrayList<DataBean>();", which i fill with the data gained from the dm system...."collection.add(new DataBean(documentType, documentDateMonth, documentDateYear));" the whole program works well in eclipse and I am able to get a pdf export, but whenever i try to connect to the datasource in iReport, it fails and gives me the error mentioned before :( any ideas? would be great ! ;) regards daniel ps: sry for bad english, haven't used it for a while, if u need more informations to help me, feel free to ask ;) Post Edited by joka83 at 04/15/2011 09:24 Link to comment Share on other sites More sharing options...
joka83 Posted April 15, 2011 Author Share Posted April 15, 2011 update:I implemented a method called "public static ArrayList<DataBean> getBeanCollection()" which returns an arraylist of beans, in iReport I created a new datsource (javabeans set datasource), with my given factory class and the methode to retrive the array or the collection of beans...(getBeanCollection)... whenever I hit "Test" i get the errormsg : "Exception General problem: null"... any ideas? i put my whole project in a jar file and published it to iReport classpath as well as all the jars needed to connect to the document management server... Link to comment Share on other sites More sharing options...
joka83 Posted April 15, 2011 Author Share Posted April 15, 2011 update again:if I comment the part in which I connect to the DM server out, and add a dummy value to my collection, the iReport datasource connection test is successfull !!! so to sum up, there must be a problem telling iReport how to connect to the DM server...any helpfull ideas? Link to comment Share on other sites More sharing options...
Timbo2013 Posted August 19, 2013 Share Posted August 19, 2013 Same case with the "general problem" here...I read about it many times and the way I fixed the "Test Connection" was to create only an empty constructor for the beanList offering class.But I've got still problems to get the data from my list correctly into my report --> subreport area is empty and the whole report is printed as often as the subreport has entries... edit:I solved the problem in another way - I added the bean to my hashmap and passed it to the subreport as a parameter... Link to comment Share on other sites More sharing options...
mmesnjak Posted November 21, 2013 Share Posted November 21, 2013 Hi Timbo2013, Can You please give an example of the code You used? 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