I am trying to use jasper reports with yii. I am using the remote xml source option in jasper reports for generating the reports. http://community.jaspersoft.com/wiki/remote-xml-datasource . The problem is that the XML generated using yii is showing error in jasper reports studio.
net.sf.jasperreports.engine.JRException: Failed to parse the xmlf document
at net.sf.jasperreports.engine.util.JRXmlUtils.parse(JRXmlUtils.java:176)
at com.jaspersoft.studio.data.querydesigner.xpath.XPathQueryDesigner$12.run(XPathQueryDesigner.java:384)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.xml.sax.SAXParseException; lineNumber: 38; columnNumber: 9; The element type "link" must be terminated by the matching end-tag "</link>".
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at net.sf.jasperreports.engine.util.JRXmlUtils.parse(JRXmlUtils.java:172)
... 2 more
I tried by generating the report using core php and it is working correctly. I used the same code,database, table and query to generate the XML.If I run the output on browser both are showing the same output.
I am using a component in the application for redirecting requests from guest users to login page.
<?php
/**
ApplicationBehavior redirects the guest user to login.
*/
class ApplicationBehavior extends CBehavior
{ private $_owner;
public function events()
{
return array(
'onBeginRequest'=>'denyEverything',
);
}
public function denyEverything()
{
$owner=$this->getOwner();
if($owner->user->getIsGuest())
{
$owner->catchAllRequest=array("site/login");
}
}
}
If I comment the line $owner->catchAllRequest=array("site/login") then xml is working in the jasper studio.