toxy Posted September 9, 2010 Share Posted September 9, 2010 Hi @all,searching this forum, I found no hint to solve my problem:I have a report (iReport 3.7.4, Win7-64) in this directory: C:\Users\Public\DocMgr\JRXML\Personen\Listen_Personen\Subreports should be placed in: C:\Users\Public\DocMgr\JRXML\subreportsAs I don't know the directory structure of the target pc, I've to address the subreport relatively. This should be solved via the parameter "SUBREPORT_DIR". This works fine if I fill it with the absolute path (C:\\Users\\Public\\DocMgr\\JRXML\\subreports\\) - but not with the relative one (..\\..\\subreports\\). I suppose, that my syntax for relative adressing is wrong... the error message is: java.lang.Exception: ..\..\subreports\mysubreport.jrmxl not foundCan anybody help?toxy Link to comment Share on other sites More sharing options...
anode36 Posted September 9, 2010 Share Posted September 9, 2010 Try this in the subreport expression:"../../subreports/reportName.jasper" Link to comment Share on other sites More sharing options...
toxy Posted September 10, 2010 Author Share Posted September 10, 2010 this have been one of my multiple tries...--> java.lang.Exception: ../../subreports/briefkopf_hoch.jrxml not foundthanks Link to comment Share on other sites More sharing options...
anode36 Posted September 10, 2010 Share Posted September 10, 2010 Hi,looks like you are calling the .jrxml file in the expression. You need to call the compiled .jasper file. (../../subreports/reportName.jasper). Hope this can help you. Link to comment Share on other sites More sharing options...
toxy Posted September 13, 2010 Author Share Posted September 13, 2010 hm, the "Subreport Expression" is $P{SUBREPORT_DIR}+"briefkopf_hoch.jasper". In the subdirectoy there are both files. Somwhere there is the setting "compile supreports" or similar... so iReports tries to compile it --> jrxml (if I understand it correctly).thankstoxy Link to comment Share on other sites More sharing options...
anode36 Posted September 15, 2010 Share Posted September 15, 2010 Hi,The jrxml file is just the file used for development. The JaspersReport engine uses the compiled file (.jasper) for processing the report. iReport automatically compile the jrxml file before executing the jasper file itself. I guess the $P{SUBREPORT_DIR} parameter defaults to the same directory as the master report like this "". If you haven't done yet maybe you need to set this parameter to "../../subreports" first. Personally I just use the relative path directly as the suberport expression, reffering to the relative location of the .jasper file. Link to comment Share on other sites More sharing options...
toxy Posted September 15, 2010 Author Share Posted September 15, 2010 anode36Wrote: Personally I just use the relative path directly as the suberport expression, reffering to the relative location of the .jasper file. This is interesting... how do you write this exactly? In my case I would write: ""..//..//subreports//briefkopf_hoch.jasper" wich is interpreted by the compiler as "../../subreports/briefkopf_hoch.jasper". This expression is correct in all my knowledge of 20 years in IT... but doesn't work! :-(greetingstoxy( backslashes printed as slashes!)Post Edited by toxy at 09/15/2010 06:46 Link to comment Share on other sites More sharing options...
toxy Posted September 15, 2010 Author Share Posted September 15, 2010 ...seems to be a problem in the settings of the installation?! toxy,continuing searching... Link to comment Share on other sites More sharing options...
lotus4 Posted March 10, 2011 Share Posted March 10, 2011 I''ve got the same problem.I want to reference a subreport in a previous folder like this:../mysubreport.jasper Every time ireport couldn't find that one.Any suggestion?Thx Link to comment Share on other sites More sharing options...
lotus4 Posted March 10, 2011 Share Posted March 10, 2011 ah, wow! i've found this topic:http://old.nabble.com/Relative-paths-to-an-image-td20342359.html it's seems to be a jdk 1.6 problem (strange..).Anyway if you put your resources in classpath it will work! ;) Link to comment Share on other sites More sharing options...
toxy Posted March 10, 2011 Author Share Posted March 10, 2011 The problem was solved by our db-developer... the calling application overwrites the parameter "SUBREPORT_DIR" with the right value of the actual installation. So I can develop my reports with a fixed subreports-path according to my installation, customer's installation doesn't bother me...toxy 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