Hi All,
Here is my JRXML code :
<?xml version="1.0" encoding="UTF-8"?>
<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="C1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="3835481c-be85-4ed0-89fa-25b226d4711f">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="137"/>
<parameter name="custTitle" class="java.lang.String"/>
<parameter name="custFullname" class="java.lang.String"/>
<parameter name="address1" class="java.lang.String"/>
<parameter name="address2" class="java.lang.String"/>
<parameter name="address3" class="java.lang.String"/>
<parameter name="custCity" class="java.lang.String"/>
<parameter name="pinCode" class="java.lang.String"/>
<parameter name="amount" class="java.lang.String"/>
<parameter name="SRDate" class="java.lang.String"/>
<parameter name="SRNumber" class="java.lang.String"/>
<parameter name="cardNumber" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<summary>
<band height="661" splitType="Stretch">
<staticText>
<reportElement uuid="7d0bb114-b36e-441a-9c8b-86d4fe7a5936" x="0" y="0" width="555" height="160"/>
<textElement/>
<text><![CDATA[
...................................................
..........................
...............
</jasperReport>
and this is how i am generating report using code :
JasperReport jasperReport = null;
JasperDesign jasperDesign = null;
Map parameters = new HashMap();
parameters.put("custTitle","Mr.");
parameters.put("custFullname","ABC");
parameters.put("address1","DEF");
parameters.put("address2","XYZ");
parameters.put("address3","POIU");
parameters.put("custCity","Asdf");
String path = getServletContext().getRealPath("/WEB-INF/");
jasperDesign = JRXmlLoader.load("path of jrxml file//C1.jrxml");
jasperReport = JasperCompileManager.compileReport(jasperDesign);
byte[] byteStream = JasperRunManager.runReportToPdf(jasperReport, parameters, conn);
// byte[] byteStream = JasperRunManager.runReportToPdf(jasperReport, parameters);
OutputStream outStream = response.getOutputStream();
response.setHeader("Content-Disposition","inline, filename=myReport.pdf");
response.setContentType("application/pdf");
response.setContentLength(byteStream.length);
outStream.write(byteStream,0,byteStream.length);
it is compiling fine and while generating through iReport also it is getting generated
but while generating through front end it showing me error :
ERROR [Digester] Parse Error at line 2 column 447: Document root element "jasperReport", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "jasperReport", must match DOCTYPE root "null".
I searched in many forums also but it showing version might be different then i compiled with same version also but then also it shows the same error, so please help me out of this....
Please tell me where i am wrong...
Thanks in Advance,
Karthik G.