Jump to content

subreports in ireports


swetha reddy

Recommended Posts

Hi,

 

I have subreports in my main report.

I have specified the full path for subreports, and the subreport is coming up properly

but 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

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

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

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 helps

Faris Zuriekat

Link to comment
Share on other sites

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 helps
Faris 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...