jasper reports - Jasperreports: HTML component with external JavaScript File - HTML Export fails on Server (but not in Ireport) -
i wanted chart data google chart api , display result in jasperserver pro 5.2. created html-componente containing the full html code inclusive <script type='text/javascript' src='https://www.google.com/jsapi'>
tag. html export works fine in ireport, html component remains empty when called on jasperserver. there no error message. (btw: when called ios 7.0.1 (jaspersoft app) iphone page displayed correctly.) tried different browsers, same thing.
can help?
please find attached jrxml
this 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="htmlcomponentreport" pagewidth="595" pageheight="842" columnwidth="515" leftmargin="40" rightmargin="40" topmargin="50" bottommargin="50" uuid="b4ad5fd2-ee36-4fc4-a326-5600945b4633"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="jrprojectid" class="java.lang.integer"> <defaultvalueexpression><![cdata[integer.valueof(287)]]></defaultvalueexpression> </parameter> <parameter name="chart" class="java.lang.string" isforprompting="false"> <defaultvalueexpression><![cdata["<!doctype html><html><head><script type='text/javascript' src='https://www.google.com/jsapi'></script><script type='text/javascript'>google.load('visualization', '1.0', {'packages':['corechart']});; google.setonloadcallback(drawchart);function drawchart() {var data = new google.visualization.datatable();data.addcolumn('string', 'topping');data.addcolumn('number', 'slices');data.addrows('mushrooms', 3],['onions', 1],['olives', 1],['zucchini', 1],['pepperoni', 2);var options = {'title':'how pizza ate last night', 'width':400,'height':300};var chart = new google.visualization.piechart(document.getelementbyid('chart_div'));chart.draw(data, options);}</script></head><body><div id='chart_div' style='width:400; height:300'></div></body></html>"]]></defaultvalueexpression> </parameter> <querystring> <![cdata[select 1 dummy]]> </querystring> <field name="dummy" class="java.lang.integer"/> <title> <band height="502"> <componentelement> <reportelement uuid="13361114-deb3-40d4-be5d-913b157ba7d3" x="0" y="0" width="515" height="472" backcolor="#add8e6"/> <hc:html xmlns:hc="http://jasperreports.sourceforge.net/htmlcomponent" xsi:schemalocation="http://jasperreports.sourceforge.net/htmlcomponent http://jasperreports.sourceforge.net/xsd/htmlcomponent.xsd" scaletype="fillframe" horizontalalign="left" verticalalign="top"> <hc:htmlcontentexpression><![cdata[$p{chart}]]></hc:htmlcontentexpression> </hc:html> </title> </jasperreport>
thanks help!
Comments
Post a Comment