teamireport Posted December 9, 2009 Share Posted December 9, 2009 HI Folks,I would like to know how to achieve accessing /creating making a datasource for my web applications different db instance.Let me tell what i have done so far.1. I have a php web application and intergrated jasperserver successfully, in jasperserver i used to create datasource say ' clientA_db' with appropriate db name correctly, and will upload jrxml in jasperserver ,will point datasource for the uploading jrxml to 'clientA_db' . My requirment is we have a different clients db with same web application jasperserver webservice intergrated ( i.e multi -tenant) .as per my first point, we able to setup jasperserver thing for 'clientA' , if we plan to access same jasperserver db for 'clientB' ,where the datasource already been created with the name of the 'clientA_db' means, how we should dynamically change datasource name to apporiate client instance database.is there any way to dynamically setup datasource via webservice as a parameter .?how we need to make it ?pl.anyone guide me how to achive this ?thanks,teamireport Link to comment Share on other sites More sharing options...
jdevine Posted December 9, 2009 Share Posted December 9, 2009 If you are using a multi-tenant setup, would it work if you just setup different datasources in each organization?org1/datasource/somedatasourceorg2/datasource/someotherdatasourceThe datasources could have same/different names and attributes as they would exist in separate organizations.I am sort of confused by your question when you say that you will access the same jasperserver db for both applications. Are you talking about the repository database here? Link to comment Share on other sites More sharing options...
teamireport Posted December 9, 2009 Author Share Posted December 9, 2009 Thanks for your quick suggestion , snip>>I am sort of confused by your question when you say that you will access the same jasperserver db for both applications. Are you talking about the repository database here? yes, i'm talking about repository database, there we hardcorde database name for the 'clientA ' in datasource . this would be likerepository jasperserver database which contains jrxml ,which always looks for 'clientA' database for all my report, since i have created datasource for 'clientA' alone, if we setup 'clientB' instance , the same jasperserver only looks for 'clientA' db,not 'clientB' here how do i change databasename in datasource of jasperserver dyanmcially for clientB .client A < ----- >jasperserver db(where hardcoded database name for 'clientA' instance alone) <---->clientB Post Edited by teamireport at 12/09/2009 18:18 Link to comment Share on other sites More sharing options...
jdevine Posted December 9, 2009 Share Posted December 9, 2009 OK, but when you said multi-tenant, I assumed that clientA & clientB would be in different organizations. Are you saying that clientA & clientB should be DS's in the same organization and configured to point to different DB's (and then you want your reports to be able to run against either)?If so, I think I better understand the question (but multi-tenant doesn't seem relevant to this discussion). Link to comment Share on other sites More sharing options...
teamireport Posted December 9, 2009 Author Share Posted December 9, 2009 Thank you so much for understanding my question. Yes, i want my reports to be configure and to run in both datasources . Link to comment Share on other sites More sharing options...
jdevine Posted December 9, 2009 Share Posted December 9, 2009 OK, now I understand, but I am not sure of the solution.One solution would be to deploy the reports to 2 different organizations and then define different datasources in each organization. Your app would then require multiple web service clients (to point at the multiple organizations).Another potential solution would be to write a custom data source. I've only implemented a custom data source that reads the connection information from a properties file, but you may be able to write it in such a way that it creates a connection based on some input parameter passed into the report (your DAO should have access to the report params).Take a look at section 5.10 of the JasperServer-Pro-Admin-Guide.pdf. (see 5.10.5 for details). Link to comment Share on other sites More sharing options...
teamireport Posted December 9, 2009 Author Share Posted December 9, 2009 Many thanks jdevine for your support. yes, solution # 1 that you mentioned ,i already had in my mind, going by solution #1 apporach what we feel means, if any changes made in organization 1 jrxml means , need to do the same in organzation 2 too without forgetting :) , we feel this apporach is fine but moving forward in future maintaining the repository db is quite hetic.so, i was looking forwards for other solution. But, yours solution #2 is quite impressive and that giving me confident to achive.let me go thru the doc in few mintues ,will get back to you,BTW, could you pl. able to attach custom data source that you have created, that surely gives me some insight. ?Post Edited by teamireport at 12/09/2009 18:46 Link to comment Share on other sites More sharing options...
jdevine Posted December 9, 2009 Share Posted December 9, 2009 jasperserver (version 3.5.1) ships with some complete examples (see samples\customDataSource).This gives an end-to-end solution as it contains jrxml, the java implementation, and the required WEB-INF files. Link to comment Share on other sites More sharing options...
teamireport Posted December 9, 2009 Author Share Posted December 9, 2009 yes, i have found the custom datasource example files as you mentioned, thanks ton !but i dont find the doc "JasperServer-Pro-Admin-Guide.pdf " :( could you pl. tell me where its available ? i have searched my whole jasperserver checkout directorycould you please ? Link to comment Share on other sites More sharing options...
jdevine Posted December 9, 2009 Share Posted December 9, 2009 I am running jasperserver-pro-3.5.1 & I am not sure if you are running the same.There should be a folder called docs on the same level as samples...otherwise just search for *.pdf Link to comment Share on other sites More sharing options...
teamireport Posted December 9, 2009 Author Share Posted December 9, 2009 Yup ! my bad , i'm using jasperserver community edition,i found the doc from jasperserver -pro which is been installed in another machine.let me go thru the doc right awayPost Edited by teamireport at 12/09/2009 19:09 Link to comment Share on other sites More sharing options...
teamireport Posted December 9, 2009 Author Share Posted December 9, 2009 Yup my bad ! i was searching in the jasperserver communtiy edition folder level.now i found the doc from jasperserver-pro . :) Link to comment Share on other sites More sharing options...
teamireport Posted December 9, 2009 Author Share Posted December 9, 2009 sorry double post Link to comment Share on other sites More sharing options...
teamireport Posted December 9, 2009 Author Share Posted December 9, 2009 jdevine ! thanks you so much for your time that you spent for replying to my qns sooner.i looked at the doc ,getting some ideas that you already mentioned.let me start doing implementing the custom datasource, if i have questions or somewhere i struggle will let u know.could you please keep watching this forum continuosly, ? i post my updated here,so that other users can benefit from our conversationonce again many thanks...bye for now will catch you by tommrow. Link to comment Share on other sites More sharing options...
revolutionizeit Posted September 24, 2011 Share Posted September 24, 2011 Hi there,Did you get the solution working with a custom datasource? I am looking for a similar solution too so any info/help will be appreciated.Cheer Link to comment Share on other sites More sharing options...
naikrish94 Posted October 13, 2017 Share Posted October 13, 2017 Hi,can somebody post solution for this using custom data source.thanks 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