swetha reddy Posted July 20, 2007 Share Posted July 20, 2007 Hi, I have subreports in my main report.I have specified the full path for subreports, and the subreport is coming up properlybut if i want this code to be submitted to the client, i cannot give the path like c:jasper.... as it will not find that path on the client machine.Can you tell me the generic path that i have to give to my subreport. My main report and subreport are in the same folder Please help me out in this as it is very urgent. Link to comment Share on other sites More sharing options...
burasami Posted July 20, 2007 Share Posted July 20, 2007 i think u have to write a one java file and convert the java file into jar file and place that jar file into ur ireport path..i have done like that its working for me Link to comment Share on other sites More sharing options...
swetha reddy Posted July 20, 2007 Author Share Posted July 20, 2007 Please let me know in detail how to do this.As we have places main and subreports in the same folder will in not fetch if we provider just the name of the subreport Link to comment Share on other sites More sharing options...
slaisne Posted July 20, 2007 Share Posted July 20, 2007 I've done the same think like burasami. I develop a specific object which return the report as an InputStream.This object have have only one method get(String templateName).If I'm under iReport, this objects returns the template under a working folder, whereas in the server side, it returns the template persisted. With this maner, you obtain a standard report, and you just need to plug specific object Link to comment Share on other sites More sharing options...
fariszuriekat Posted July 28, 2007 Share Posted July 28, 2007 Try to make the pathname dynamic, you should be able to include that in the system properties. so if you run it on different system your reports will still work without the need to hard code the pathname. Create a parameter in your report that holds the pathname. and fill that dynamicly with the correct path when you upload the report online. Hope this idea helpsFaris Zuriekat Link to comment Share on other sites More sharing options...
giroe Posted July 30, 2007 Share Posted July 30, 2007 fariszuriekat wrote:Try to make the pathname dynamic, you should be able to include that in the system properties. so if you run it on different system your reports will still work without the need to hard code the pathname. Create a parameter in your report that holds the pathname. and fill that dynamicly with the correct path when you upload the report online.Hope this idea helpsFaris Zuriekat This is the way to do it imo, thats the way I do it, and it seems a LOT easier than working with jarfiles etc. Just put String path=request.getRealPath("path to the map where your report is located, starting with WEB-INF") in a parameter of your report. path will be dynamic, if your tomcat is located on your E drive it will start with E, if it will be on C than path wil start with C etc.. 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