fenix4life Posted November 4, 2009 Share Posted November 4, 2009 Hello,I've searched in the jasper reports and ireport forum but not really found was I was looking for. It could be that was I am aiming for is not possible and should be done in the alternative way.What we like to achieve is a merge of 2 differente datasources in 1 report.eg. -> Database connection (Oracle, SQL Server) with a list of Options-> A webservice which gives pack a number of prices Both the database connection and webservice need a parameter to retrieve the information of a vehicle.Database for vehicle A ID Descr2 X9 Y15 ZWebService for vehicle AID Price2 5,59 1015 12,99 What I need to display on the detail section would be the merge of both datasourcesDescr PriceX 5,5Y 10Z 12,99Using a subreport to retrieve the price information is not really a useable option. We could use some variables to retrieve the price for every specific option but I do not now beforehand how many options and which ID's they have. A different case is slightly more easier.Still 2 data sources. One database, one webservice. The result of one field from the database is needed as a parameter of the webservice request.In some examples the connections are being prepared within the java code but what about passed parameters afterwards. Does any one has an idea how this could be achieved?If possible some simple examples (jrxml and java) Kind Regards Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted November 4, 2009 Share Posted November 4, 2009 There are several solutions1. a custom data source which merges both the webservice and the SQL call2. an helper class to execute the webservice to get the value of a specific item3. Create some beans, prepare them on the java side and use them to populate the report without care about where the data comes from4. Use a subreport to populate a collection returned to the master with the web service call result (the subreport can be 1pixel x 1pixel5. Use the same trick in 4 but using an helper class and a fake printWhenExpressionothers?Giulio Link to comment Share on other sites More sharing options...
fenix4life Posted November 5, 2009 Author Share Posted November 5, 2009 Thx, for the possible solutions. The fourth solution would be the one best suiting or needs. Would it be possible having a small example how to transfer the collection from the subreport to the master and how to join them. Kind Regards, Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted November 5, 2009 Share Posted November 5, 2009 it would be very specific. The general idea is to use a subreport return value (see the bottom of the subreport element property sheet). The way you collect the data in the report and transfer it to the master is up to you. Giulio 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