title: Working with SVG FILES in iReport gives JRExpressionEvalException: Error evaluating expression : Source Text
body: <p>I've been working in an web project where the client needs to show a report like an Id card. I designed the structure of the report in Illustrator and exported as SVG, so BatikRenderer handles the file and shows it in the report. And in <em>iReport</em> just include the fields I'm going to show. So basically it works in <em>iReport Designer 5.5.0</em>.</p>
  
  <p>When I Compile it and shows the preview. It seems like everything is ok.</p>
  
  <p><img src="https://i.stack.imgur.com/vna5N.png" alt="enter image description here"></p>
  
  <p>Here is my jrxml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="prueba" whenNoDataType="AllSectionsNoDetail" language="groovy" pageWidth="180" pageHeight="288" columnWidth="180" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="2cedbacf-8972-4cbe-bf07-7d3af62126d5"&gt;
  &lt;detail&gt;
      &lt;band height="288" splitType="Stretch"&gt;
          &lt;image&gt;
              &lt;reportElement x="0" y="0" width="180" height="288" uuid="3c8031c1-70ca-4e47-be8e-735b90b7797a"/&gt;
  &lt;imageExpression class="net.sf.jasperreports.engine.JRRenderable"&gt;&lt;![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromLocation("svg-design.svg")]]&gt;&lt;/imageExpression&gt;
          &lt;/image&gt;
      &lt;/band&gt;
  &lt;/detail&gt;
      &lt;/jasperReport&gt;
  </code></pre>
  
  <p>I used the other variation with the absolute path and it works too :</p>
  
  <pre><code>&lt;![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstance(new java.io.File("/Users/RogelioMonge/Dropbox/Adepafut/src/java/com/adepafut/common/reports/svg-design.svg"))]]&gt;
  </code></pre>
  
  <p>The problem is when I try to execute the report from my app. Im using my report with an Empty Data Source, just for the SVG test, I need to achieve this first so I can continue with the filling of the report with the DataSource.</p>
  
  <p>Here is the dummy code I used to test the report:</p>
  
  <pre><code>try {
      Map&lt;String, Object&gt; parameters = new HashMap&lt;String, Object&gt;();
      JRDataSource dataSource = null;
      InputStream report = this.getClass().getClassLoader().getResourceAsStream(JugadorReportEnum.PATH_REPORT.getValue());
      JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, dataSource);
      JasperViewer jv = new JasperViewer(jasperPrint, false);
      jv.viewReport(jasperPrint, false);
  } catch (JRException ex) {
      Logger.getLogger(ReportHandler.class.getName()).log(Level.SEVERE, null, ex);
  }
  </code></pre>
  
  <p>Here is the Exception:</p>
  
  <pre><code>ex = (net.sf.jasperreports.engine.fill.JRExpressionEvalException)net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : 
  Source text : net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromLocation("svg-design.svg")
  </code></pre>