title: Linking subreports in iReport so they also work in Jasper server
body: <p>Using iReport v4.0.1 with Jasperserver v4.1.0 I'm trying to find a syntax for linking subreports to the main report that lets me test it in iReport then deploy to the server through the repository browser.</p>
  
  <p>The default syntax for sub-reports in iReport for the subreport expression is something like</p>
  
  <pre><code>$P{SUBREPORT_DIR} + "mySubReport.jasper"
  </code></pre>
  
  <p>When you deploy this from iReport it's smart enough to pick this up and suggest changing it to</p>
  
  <pre><code>"repo:mySubReport.jrxml"
  </code></pre>
  
  <p>and to then deploy all subreports to the Resources folder of the main report. </p>
  
  <p>That's great, but unfortunately it then edits the file in iReport to save this change which means you can no longer run the report in iReport without manually re-editing all the sub-report expressions - this makes the process of testing and deploying to the server really painful, particularly when there are multiple sub-reports in a report.</p>
  
  <p>I thought I could at least set the value of $P{SUBREPORT} to be "repo:" or "My\local\filepath" so that at least I'd only have one place to change it, but the compiler doesn't like that.</p>
  
  <p>Is there an alternative structure or an expression that will resolve to repo:*.jrxml or My\local\filepath*.jasper correctly depending on where you're running the report from?</p>