Is it possible to convert this
<boxed-text>
<para role="Box legend">Box 2 Caption</para>
<para role="Box head">Text Text Text</para>
<para role="Box text">Text Text Text.<sup>1</sup></para>
<para role="Box subhead A">Text Text Text</para>
<para role="Box text">Text Text Text.</para>
<para role="Box subhead A">Text Text Text</para>
<para role="Box text">Text Text Text.</para>
<para role="Box subhead B">Text Text Text</para>
<para role="Box text">Text Text Text.</para>
</boxed-text>
into something like this?
<boxed-text>
<caption><para>Box 2 Caption</para></caption>
<para>Text Text Text</para>
<para>Text Text Text.<sup>1</sup></para>
<sec>
<title>Text Text Text</title>
<para>Text Text Text.</para>
</sec>
<sec>
<title>Text Text Text</title>
<para>Text Text Text.</para>
<sec>
<title>Text Text Text</title>
<para>Text Text Text.</para>
</sec>
</sec>
</boxed-text>
However, subheads may not appear, thus,
<boxed-text>
<para role="Box legend">Box 2 Caption</para>
<para role="Box head">Text Text Text</para>
<para role="Box text">Text Text Text.<sup>1</sup></para>
<para role="Box text">Text Text Text.</para>
<para role="Box text">Text Text Text.</para>
<para role="Box text">Text Text Text.</para>
</boxed-text>
should produce
<boxed-text>
<caption><para>Box 2 Caption</para></caption>
<para>Text Text Text</para>
<para>Text Text Text.<sup>1</sup></para>
<para>Text Text Text.</para>
<para>Text Text Text.</para>
<para>Text Text Text.</para>
</boxed-text>
I am having a hard time getting this done with xsl:for-each-group. An answer will be much appreciated. Thanks in advance!
Here is my edited suggestion, incorporating a slight change to make sure we process all para elements when there is nothing to group:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mf="http://example.com/mf"
exclude-result-prefixes="xs mf"
version="2.0">
<xsl:param name="group-role" select="'Box subhead '"/>
<xsl:output indent="yes"/>
<xsl:function name="mf:group" as="element()*">
<xsl:param name="paras" as="element(para)*"/>
<xsl:param name="head" as="xs:string"/>
<xsl:for-each-group select="$paras" group-starting-with="para[#role = concat($group-role, $head)]">
<xsl:choose>
<xsl:when test="self::para[#role = concat($group-role, $head)]">
<sec>
<xsl:apply-templates select="."/>
<xsl:sequence select="mf:group(current-group() except ., codepoints-to-string(string-to-codepoints($head)[1] + 1))"/>
</sec>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="current-group()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each-group>
</xsl:function>
<xsl:template match="#* | node()">
<xsl:copy>
<xsl:apply-templates select="#* , node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="boxed-text">
<xsl:copy>
<xsl:variable name="first-sh" select="para[#role = concat($group-role, 'A')][1]"/>
<xsl:apply-templates select="if ($first-sh) then $first-sh/preceding-sibling::para else para"/>
<xsl:sequence select="mf:group(($first-sh, $first-sh/following-sibling::para), 'A')"/>
</xsl:copy>
</xsl:template>
<xsl:template match="para[matches(#role, concat($group-role, '[A-Z]'))]">
<title>
<xsl:apply-templates/>
</title>
</xsl:template>
<xsl:template match="para[#role = 'Box legend']">
<caption>
<para>
<xsl:apply-templates/>
</para>
</caption>
</xsl:template>
<xsl:template match="para[#role = ('Box head', 'Box text')]">
<para>
<xsl:apply-templates/>
</para>
</xsl:template>
</xsl:stylesheet>
When applied to the input
<boxed-text>
<para role="Box legend">Box 2 Caption</para>
<para role="Box head">Text Text Text</para>
<para role="Box text">Text Text Text.<sup>1</sup></para>
<para role="Box subhead A">Text Text Text</para>
<para role="Box text">Text Text Text.</para>
<para role="Box subhead A">Text Text Text</para>
<para role="Box text">Text Text Text.</para>
<para role="Box subhead B">Text Text Text</para>
<para role="Box text">Text Text Text.</para>
</boxed-text>
with Saxon 9.4 I get the result
<boxed-text>
<caption>
<para>Box 2 Caption</para>
</caption>
<para>Text Text Text</para>
<para>Text Text Text.<sup>1</sup>
</para>
<sec>
<title>Text Text Text</title>
<para>Text Text Text.</para>
</sec>
<sec>
<title>Text Text Text</title>
<para>Text Text Text.</para>
<sec>
<title>Text Text Text</title>
<para>Text Text Text.</para>
</sec>
</sec>
</boxed-text>
When applied to the input
<boxed-text>
<para role="Box legend">Box 2 Caption</para>
<para role="Box head">Text Text Text</para>
<para role="Box text">Text Text Text.<sup>1</sup></para>
<para role="Box text">Text Text Text.</para>
<para role="Box text">Text Text Text.</para>
<para role="Box text">Text Text Text.</para>
</boxed-text>
I get the result
<boxed-text>
<caption>
<para>Box 2 Caption</para>
</caption>
<para>Text Text Text</para>
<para>Text Text Text.<sup>1</sup>
</para>
<para>Text Text Text.</para>
<para>Text Text Text.</para>
<para>Text Text Text.</para>
</boxed-text>
Related
I added an SVG chart to a PDF with Itext 7.1.14.
On Windows and Android, it worked normally.
However, on the iPhone or Macbook, the text is upside down and everything is on top, on the left side.
What can I do to resolve this?
Compare:
Image 1 - On Windows and Android
Image 2 - On iPhone
Code to generate the chart with Google Charts:
google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable(participantesGrafico);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{
calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation"
},
2]);
//let fonte = 'bebas';
let fonte = 'Arial';
var options = {
title: "MÉDIAS",
width: 700,
height: 50 * participantes.length,
bar: { groupWidth: "80%" },
legend: { position: "none" },
chartArea: {
top: 20,
bottom: 20,
left: 100,
right: 20
},
hAxis: { textStyle: { fontName: fonte }, titleTextStyle: { fontName: fonte } },
vAxis: { textStyle: { fontName: fonte }, titleTextStyle: { fontName: fonte } },
titleTextStyle: { fontName: fonte },
tooltip: { textStyle: { fontName: fonte } },
fontName: fonte,
};
var chart = new google.visualization.BarChart(document.getElementById("graficoMedias"));
chart.draw(view, options);
}
Get in SVG. From SVG to String:
var grafico1 = document.getElementById('graficoMedias').getElementsByTagName('svg')[0].outerHTML;
SVG generated by Google Chart:
<svg width="700" height="200" aria-label="A chart." style="overflow: hidden;"><defs id="_ABSTRACT_RENDERER_ID_0"><clipPath id="_ABSTRACT_RENDERER_ID_1"><rect x="100" y="20" width="580" height="160"></rect></clipPath><filter id="_ABSTRACT_RENDERER_ID_2"><feGaussianBlur in="SourceAlpha" stdDeviation="2"></feGaussianBlur><feOffset dx="1" dy="1"></feOffset><feComponentTransfer><feFuncA type="linear" slope="0.1"></feFuncA></feComponentTransfer><feMerge><feMergeNode></feMergeNode><feMergeNode in="SourceGraphic"></feMergeNode></feMerge></filter></defs><rect x="0" y="0" width="700" height="200" stroke="none" stroke-width="0" fill="#ffffff"></rect><g><text text-anchor="start" x="100" y="14.2" font-family="Arial" font-size="12" font-weight="bold" stroke="none" stroke-width="0" fill="#000000">MÉDIAS</text><rect x="100" y="4" width="580" height="12" stroke="none" stroke-width="0" fill-opacity="0" fill="#ffffff"></rect></g><g><rect x="100" y="20" width="580" height="160" stroke="none" stroke-width="0" fill-opacity="0" fill="#ffffff"></rect><g clip-path="url(https://localhost:44322/Evento/Evento/976#_ABSTRACT_RENDERER_ID_1)"><g><rect x="100" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#cccccc"></rect><rect x="216" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#cccccc"></rect><rect x="332" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#cccccc"></rect><rect x="447" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#cccccc"></rect><rect x="563" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#cccccc"></rect><rect x="679" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#cccccc"></rect><rect x="158" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#ebebeb"></rect><rect x="274" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#ebebeb"></rect><rect x="390" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#ebebeb"></rect><rect x="505" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#ebebeb"></rect><rect x="621" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#ebebeb"></rect></g><g><rect x="101" y="24" width="216" height="32" stroke="#3f51b5" stroke-width="1" fill="#3f51b5"></rect><rect x="101" y="64" width="303" height="32" stroke="#3f51b5" stroke-width="1" fill="#3f51b5"></rect><rect x="101" y="104" width="506" height="32" stroke="#3f51b5" stroke-width="1" fill="#3f51b5"></rect><rect x="101" y="144" width="419" height="32" stroke="#3f51b5" stroke-width="1" fill="#3f51b5"></rect></g><g><rect x="100" y="20" width="1" height="160" stroke="none" stroke-width="0" fill="#333333"></rect></g><g><rect x="317" y="40" width="0" height="1" stroke="none" stroke-width="0" fill="#999999"></rect><rect x="404" y="80" width="0" height="1" stroke="none" stroke-width="0" fill="#999999"></rect><rect x="607" y="120" width="0" height="1" stroke="none" stroke-width="0" fill="#999999"></rect><rect x="520" y="160" width="0" height="1" stroke="none" stroke-width="0" fill="#999999"></rect></g></g><g></g><g><g><text text-anchor="middle" x="100.5" y="194.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#444444">0</text></g><g><text text-anchor="middle" x="216.3" y="194.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#444444">2</text></g><g><text text-anchor="middle" x="332.1" y="194.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#444444">4</text></g><g><text text-anchor="middle" x="447.9" y="194.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#444444">6</text></g><g><text text-anchor="middle" x="563.7" y="194.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#444444">8</text></g><g><text text-anchor="middle" x="679.5" y="194.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#444444">10</text></g><g><text text-anchor="end" x="88" y="44.575" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#222222">Chromium</text></g><g><text text-anchor="end" x="88" y="84.325" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#222222">Edge</text></g><g><text text-anchor="end" x="88" y="124.075" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#222222">Firefox</text></g><g><text text-anchor="end" x="88" y="163.825" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#222222">Opera</text></g></g><g><g><g><text text-anchor="end" x="313" y="44.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#ffffff">3.74</text><rect x="290" y="34" width="23" height="12" stroke="none" stroke-width="0" fill-opacity="0" fill="#ffffff"></rect></g></g><g><g><text text-anchor="end" x="400" y="84.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#ffffff">5.25</text><rect x="377" y="74" width="23" height="12" stroke="none" stroke-width="0" fill-opacity="0" fill="#ffffff"></rect></g></g><g><g><text text-anchor="end" x="603" y="124.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#ffffff">8.75</text><rect x="580" y="114" width="23" height="12" stroke="none" stroke-width="0" fill-opacity="0" fill="#ffffff"></rect></g></g><g><g><text text-anchor="end" x="516" y="164.2" font-family="Arial" font-size="12" stroke="none" stroke-width="0" fill="#ffffff">7.25</text><rect x="493" y="154" width="23" height="12" stroke="none" stroke-width="0" fill-opacity="0" fill="#ffffff"></rect></g></g></g></g><g></g></svg>
C# code:
byte[] b = Encoding.UTF8.GetBytes(grafico1);
MemoryStream ms2 = new MemoryStream(b);
Image i = SvgConverter.ConvertToImage(ms2, document.GetPdfDocument());
document.Add(i);
I have an SVG that doesn't seem to work with iOS devices.
I've tried in both chrome and safari only the SVG appears as a solid blue block colour and doesn't preserve the different layers and their opacity levels...
https://jsfiddle.net/2fLuspdm/
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1920 3840" style="enable-background:new 0 0 1920 3840;" xml:space="preserve">
<style type="text/css">
.st0{opacity:6.000000e-02;fill:#609FD0;enable-background:new ;}
</style>
<polygon class="st0" points="1920,2614 1920,3641 1470,3005.1 "/>
<polygon class="st0" points="1920,1612.4 1210,780 1920,0.4 "/>
<polyline class="st0" points="0,0 650,0 0,1184.3 1,0 "/>
<polygon class="st0" points="0,898.4 960,1457 0,2778.4 "/>
<polygon class="st0" points="0,3837.4 0,2654 1040,3840 "/>
<polygon class="st0" points="1920,2926 1424,2239 1920,1046 "/>
<polygon class="st0" points="829,3840 1920,2926 1936,3840 "/>
<polygon class="st0" points="0,2530 0,1760 960,2909 "/>
<polygon class="st0" points="1920,0.4 1920,622 40,0.4 "/>
<polygon class="st0" points="1920,1634.5 1920,2404.5 1150,1435.5 "/>
</svg>
Simply compute the exponential (not sure if it's valid SVG syntax, but Safari doesn't like it).
<style type="text/css">
.st0{opacity:.06; fill:#609FD0; enable-background:new ;}
</style>
I want to use a custom cursor in my SVG file.
The cursor is defined in the same SVG file as the rest of my document:
<defs>
<g id="cursor-symbol">
<circle fill-opacity="0.8" fill="white" r="10.0" cx="10.0" cy="10.0" stroke="black" stroke-width="2.0" stroke-opacity="1"/>
<line y2="20.0" x1="10.0" x2="0.0" transform="rotate(45.0, 10.0, 10.0)" y1="10.0"/>
</g>
</defs>
Then I tried to use that cursor, but can't find out how to reference it:
<rect cursor="url(#cursor-symbol)" x="0" y="0" width="100" height="100" />
The attribute value seems to be invalid.
I also created a cursor element and tried with that:
<defs>
<g id="cursor-symbol">
<circle fill-opacity="0.8" fill="white" r="10.0" cx="10.0" cy="10.0" stroke="black" stroke-width="2.0" stroke-opacity="1"/>
<line y2="20.0" x1="10.0" x2="0.0" transform="rotate(45.0, 10.0, 10.0)" y1="10.0"/>
</g>
<cursor id="cursor" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cursor-symbol"/>
</defs>
...
<rect cursor="url(#cursor)" x="0" y="0" width="100" height="100" />
but to no avail.
How to I reference such a cursor that is defined in the same document?
Hopefully not too much of an Orbeon-noob question. I have built a custom control for Orbeon (a simple slider for now) and was wanting to add the ability to change the min, max and step parameters for the range input in the Basic Settings dialog. I have had a look at the Dynamic Driven Dropdown and have added the control-details section in the control metadata, but I am stumped on how to get them to show up and how to use the value on the actual input element. Any help / example code would be hugely appreciated.
<xbl:xbl xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xbl:binding id="fr-slider" element="fr|slider"
xxf:external-events="fr-value-changed"
xxbl:mode="lhha binding value">
<metadata xmlns="http://orbeon.org/oxf/xml/form-builder">
<display-name lang="en">Slider</display-name>
<icon lang="en">
<small-icon>/forms/orbeon/builder/images/timeline_marker.png</small-icon>
<large-icon>/forms/orbeon/builder/images/timeline_marker.png</large-icon>
</icon>
<datatype>xf:number</datatype>
<template>
<fr:slider>
<xf:label ref=""/>
<xf:hint ref=""/>
<xf:help ref=""/>
<xf:alert ref=""/>
<xf:min ref=""/>
<xf:max ref=""/>
<xf:step ref=""/>
</fr:slider>
</template>
<control-details>
<xf:input ref="xf:min/#ref" type="number">
<xf:label>Minimum Value</xf:label>
<xf:hint />
</xf:input>
<xf:input ref="xf:max/#ref" type="number">
<xf:label>Maximum Value</xf:label>
<xf:hint />
</xf:input>
<xf:input ref="xf:step/#ref" type="number">
<xf:label>Step Size</xf:label>
<xf:hint>Smallest change in value the slider will allow</xf:hint>
</xf:input>
</control-details>
</metadata>
<xbl:resource>
<xbl:style>
input.fr-slider { width: 100% };
</xbl:style>
</xbl:resource>
<xbl:template xxbl:transform="oxf:unsafe-xslt">
<xsl:transform version="2.0">
<xsl:import href="oxf:/oxf/xslt/utils/xbl.xsl"/>
<xsl:template match="/*">
<xh:input type="range" min="0" max="10" step="1" class="fr-slider"/>
</xsl:template>
</xsl:transform>
</xbl:template>
</xbl:binding>
</xbl:xbl>
To get the inputs in the <control-detail> to show in the Basic Settings dialog, you need to add a lang parameter to the <xf:label> and <xf:hint> elements (thanks to #avernet for solving this).
Below is a full example of a custom control cust:betterinput that uses an xhtml input element for its input. It uses custom settings (and also the data type [set in Control Settings -> Validation and Alerts -> Data Type]) to configure parameters on the html element (note that the custom parameters have been changed to control parameters). Javascript is used to sync the value between the xhtml input and the xforms input (so that the value is captured by Orbeon). The example is based on number control included in Orbeon
xbl/cust/betterinput/betterinput.xbl
<xbl:xbl xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cust="http://www.cust.com/">
<xbl:script src="/xbl/cust/betterinput/betterinput.js"/>
<xbl:binding
id="cust-betterinput"
element="cust|betterinput"
xxbl:mode="lhha binding value focus"
xxbl:label-for="html-input">
<metadata xmlns="http://orbeon.org/oxf/xml/form-builder">
<display-name lang="en">Better Input</display-name>
<icon lang="en">
<small-icon>/forms/orbeon/builder/images/input.png</small-icon>
<large-icon>/forms/orbeon/builder/images/input.png</large-icon>
</icon>
<description lang="en"/>
<templates>
<view>
<cust:betterinput type="" prefix="" suffix="">
<xf:label ref=""/>
<xf:hint ref=""/>
<xf:help ref=""/>
<xf:alert ref=""/>
</cust:betterinput>
</view>
</templates>
<control-details>
<xf:input ref="#type">
<xf:label lang="en">Input Type</xf:label>
<xf:hint lang="en">HTML5 Input Type</xf:hint>
</xf:input>
<xf:input ref="#prefix">
<xf:label lang="en">Input Prefix</xf:label>
<xf:hint/>
</xf:input>
<xf:input ref="#suffix">
<xf:label lang="en">Input Suffix</xf:label>
<xf:hint/>
</xf:input>
</control-details>
</metadata>
<xbl:resources>
<xbl:style src="/xbl/cust/betterinput/betterinput.css"/>
</xbl:resources>
<xbl:template xxbl:transform="oxf:unsafe-xslt">
<xsl:transform version="2.0">
<xsl:import href="oxf:/oxf/xslt/utils/xbl.xsl"/>
<xsl:template match="/*">
<xsl:variable
name="js-object"
as="xs:string"
select="'YAHOO.xbl.cust.BetterInput.instance(this)'"/>
<xf:group>
<xf:action type="javascript" ev:event="xforms-disabled" ev:target="#observer">
<xsl:value-of select="$js-object"/>.destroy();
</xf:action>
<xf:var name="binding" value="xxf:binding('cust-betterinput')"/>
<xf:var name="view"
value="exf:readonly($binding) and property('xxf:readonly-appearance') = 'static'"/>
<xf:action
ev:target="#observer"
ev:event="xforms-enabled xforms-value-changed">
<xxf:script>
<xsl:value-of select="$js-object"/>.updateWithServerValue();
</xxf:script>
</xf:action>
<xf:action
ev:target="#observer"
ev:event="DOMFocusOut">
<xxf:script>
<xsl:value-of select="$js-object"/>.updateWithServerValue();
</xxf:script>
</xf:action>
<xf:var name="htmlinputs" value="' email url color number datetime-local '" />
<xsl:copy-of select="xxbl:parameter(., 'type')"/>
<xsl:copy-of select="xxbl:parameter(., 'prefix')"/>
<xsl:copy-of select="xxbl:parameter(., 'suffix')"/>
<xf:group ref="$binding[not($view)]">
<xf:input ref="." class="betterinput-xform-input xforms-hidden">
<xf:action type="javascript" id="xf-ro" ev:event="xforms-readonly"><xsl:value-of select="$js-object"/>.readonly();</xf:action>
<xf:action type="javascript" id="xf-rw" ev:event="xforms-readwrite"><xsl:value-of select="$js-object"/>.readwrite();</xf:action>
</xf:input>
<xh:span class="{{(if ($prefix) then 'input-prepend' else (), if ($suffix) then 'input-append' else ())}}">
<xf:group class="add-on" ref=".[$prefix]"><xf:output value="$prefix"/></xf:group>
<xh:input id="html-input" class="betterinput-html-input" type="{{
if (not(type = '') and contains($htmlinputs, concat(' ', $type, ' '))) then
$type
else
if (contains(' decimal integer double ', concat(' ', xxf:type($binding), ' '))) then
'number'
else
if (contains($htmlinputs, concat(' ', xxf:type($binding), ' '))) then
xxf:type($binding)
else
'text'
}}"/>
<xf:group class="add-on" ref=".[$suffix]"><xf:output value="$suffix"/></xf:group>
</xh:span>
</xf:group>
<!-- Static readonly mode -->
<xf:group ref="$binding[$view]" class="{{(if ($prefix) then 'input-prepend' else (), if ($suffix) then 'input-append' else ())}}">
<xf:group class="add-on" ref=".[$prefix]"><xf:output value="$prefix"/></xf:group>
<xf:input ref="$binding[$view]" class="betterinput-html-input" />
<xf:group class="add-on" ref=".[$suffix]"><xf:output value="$suffix"/></xf:group>
</xf:group>
</xf:group>
</xsl:template>
</xsl:transform>
</xbl:template>
</xbl:binding>
</xbl:xbl>
xbl/cust/betterinput/betterinput.js
(function() {
var $ = ORBEON.jQuery;
var AS = ORBEON.xforms.server.AjaxServer;
var Document = ORBEON.xforms.Document;
YAHOO.namespace("xbl.cust");
YAHOO.xbl.cust.BetterInput = function() {};
ORBEON.xforms.XBL.declareClass(YAHOO.xbl.cust.BetterInput, "xbl-cust-betterinput");
YAHOO.xbl.cust.BetterInput.prototype = {
xformsInputElement: null,
visibleInputElement: null,
prefixElement: null,
prefix: null,
init: function() {
// Get information from the DOM
console.log('betterinput init');
this.xformsInputElement = YAHOO.util.Dom.getElementsByClassName("betterinput-xform-input", null, this.container)[0];
this.visibleInputElement = YAHOO.util.Dom.getElementsByClassName("betterinput-html-input", null, this.container)[0];
// Properties
// Find prefix based on class/control name, as this JS can be used with fr:number and fr:currency and properties use the control name
var controlClassPrefix = null;
var containerClasses = this.container.className.split(" ");
for (var classIndex = 0; classIndex < containerClasses.length; classIndex++) {
var currentClass = containerClasses[classIndex];
if (currentClass.indexOf("xbl-cust-") == 0) {
controlClassPrefix = currentClass;
break;
}
}
this.prefixElement = YAHOO.util.Dom.getElementsByClassName(controlClassPrefix + "-prefix", null, this.container)[0];
this.prefix = Document.getValue(this.prefixElement.id);
// Register listeners
// Restore input type, send the value to the server, and updates value after server response
$(this.visibleInputElement).on('change blur', _.bind(function(e) {
this.sendValueToServer();
var formId = $(this.container).parents('form').attr('id');
// Always update visible value with XForms value
// - relying just value change event from server is not enough
// - value change not dispatched if server value hasn't changed
// - if visible changed, but XForms hasn't, we still need to show XForms value
// - see: https://github.com/orbeon/orbeon-forms/issues/1026
AS.nextAjaxResponse(formId).then(_.bind(this.updateWithServerValue, this));
}, this));
$(this.visibleInputElement).on('keypress', _.bind(function(e) {
if (e.which == 13)
this.sendValueToServer();
}, this));
},
setFocus: function() {
this.visibleInputElement.focus();
},
sendValueToServer: function() {
var newValue = this.visibleInputElement.value;
Document.setValue(this.xformsInputElement.id, newValue);
},
updateWithServerValue: function() {
var value = Document.getValue(this.xformsInputElement.id);
this.visibleInputElement.value = value;
// Also update disabled because this might be called upon an iteration being moved, in which case all the control properties must be updated
this.visibleInputElement.disabled = YAHOO.util.Dom.hasClass(this.xformsInputElement, "xforms-readonly");
},
readonly: function() {
this.visibleInputElement.disabled = true;
},
readwrite: function() {
this.visibleInputElement.disabled = false;
},
};
})();
I am using JasperReports and Struts2 to make to make some reports in my web application .
I am doing all this stuff with NetBeans IDE and iReport 3.5.1 plugin for designing purpose.
I am configuring my struts2-jasperreports plugin by following xml code.
<package name="jasper1" extends="jasperreports-default,struts-default">
<result-types>
<result-type name="jasper" class="org.apache.struts2.views.jasperreports.JasperReportsResult"/>
</result-types>
<action name="myJasperTest" class="testJasperAccountAction">
<result name="success" type="jasper">
<param name="location">/reports/account.jasper</param>
<param name="dataSource">accounts</param>
<param name="format">PDF</param>
</result>
<result name="error" type="jasper">/error.jsp</result>
</action>
</package>
My action class is as follows.
public class JasperAccountAction extends ActionSupport {
private IAccountSecurityProcessor accountSecurityProcessor;
private static ArrayList<Account> accounts;
public void setAccounts(ArrayList<Account> accounts) {
JasperAccountAction.accounts = accounts;
}
#Override
public String execute() throws Exception {
return SUCCESS;
}
public void setAccountSecurityProcessor(IAccountSecurityProcessor accountSecurityProcessor) {
this.accountSecurityProcessor = accountSecurityProcessor;
}
public ArrayList<Account> getAccounts() throws Exception {
try {
accounts = (ArrayList<Account>) this.accountSecurityProcessor.findByAll(0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, false, null, null, null, null, 0);
JasperCompileManager.compileReportToFile("E:\\Final_copy_of_erp\\SufalamERP\\build\\web\\reports\\account.jrxml", "E:\\Final_copy_of_erp\\SufalamERP\\build\\web\\reports\\account.jasper");
System.out.println("*******************************Accounts list for japser = =" + accounts + " ****************************************");
} catch (SufalamException ex) {
ex.printStackTrace();
System.out.println("*******************************Exception in sufalam ==>" + ex);
Logger.getLogger(JasperAccountAction.class.getName()).log(Level.SEVERE, null, ex);
}
return accounts;
}
}
my jasper report is as follows:
<?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="null" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<queryString language="SQL">
<![CDATA[SELECT
account_master."id" AS account_master_id,
account_master."name" AS account_master_name
FROM
"public"."account_master" account_master]]>
</queryString>
<field name="account_master_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="account_master_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<group name="account_master_id">
<groupExpression><![CDATA[$F{account_master_id}]]></groupExpression>
<groupHeader>
<band height="27">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="139" height="27" forecolor="#FFFFFF" backcolor="#000000"/>
<textElement>
<font size="18"/>
</textElement>
<text><![CDATA[account_master_id]]></text>
</staticText>
<textField>
<reportElement mode="Opaque" x="139" y="0" width="416" height="27" forecolor="#FFFFFF" backcolor="#000000"/>
<textElement>
<font size="18" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Integer"><![CDATA[$F{account_master_id}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
<groupFooter>
<band height="8">
<line direction="BottomUp">
<reportElement key="line" x="1" y="4" width="554" height="1"/>
</line>
</band>
</groupFooter>
</group>
<background>
<band/>
</background>
<title>
<band height="58">
<line>
<reportElement x="0" y="8" width="555" height="1"/>
</line>
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/>
</line>
<staticText>
<reportElement x="65" y="13" width="424" height="35"/>
<textElement textAlignment="Center">
<font size="26" isBold="true"/>
</textElement>
<text><![CDATA[Classic template]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band/>
</pageHeader>
<columnHeader>
<band/>
</columnHeader>
<detail>
<band height="20">
<staticText>
<reportElement x="0" y="0" width="139" height="20"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[account_master_name]]></text>
</staticText>
<textField>
<reportElement x="139" y="0" width="416" height="20"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{account_master_name}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band/>
</columnFooter>
<pageFooter>
<band height="26">
<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
<reportElement key="textField" x="516" y="6" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField" x="342" y="6" width="170" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Right">
<font size="10"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField" x="1" y="6" width="209" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band/>
</summary>
</jasperReport>
and i using following jars in my project.
asm.jar
cglib.jar
commons-fileupload-1.2.1.jar
displaytag-export-poi-1.2.jar
hibernate3.jar
jasperreports-3.0.0.jar
org.apache.commons.logging_1.0.4.jar
struts2-core-2.0.11.1.jar
tiles-core-2.1.2.jar
xwork-2.1.2.jar
batik-dom.jar
batik-svg-dom.jar
groovy-all-1.5.5.jar
jaxen-1.1.1.jar
jxl-2.6.jar
rhino-1.7R1.jar
commons-lang-2.3.jar
displaytag-portlet-1.2.jar
hibernate-annotations.jar
jdt-compiler-3.1.1.jar
postgresql-8.3-603.jdbc3.jar
struts2-jasperreports-plugin-2.0.11.1.jar
tiles-jsp-2.1.2.jar
batik-anim.jar
batik-ext.jar
batik-svggen.jar
jakarta-bcel-20050813.jar
jcommon-1.0.15.jar
kxml2-2.3.0.jar
xalan.jar
commons-beanutils-1.7.0.jar
commons-logging-1.0.4.jar
dom4j.jar
hibernate-commons-annotations.jar
jta.jar
slf4j-api.jar
struts2-spring-plugin-2.0.11.1.jar
tiles-portlet-2.1.2.jar
batik-awt-util.jar
batik-gvt.jar
batik-util.jar
jasperreports-chart-themes-3.5.1.jar
xml-apis-ext.jar
kxml2-min-2.3.0.jar
xercesImpl.jar
commons-collections.jar
commons-logging-api-1.1.jar
ejb3-persistence.jar
hibernate-core.jar
log4j.jar
slf4j-log4j12.jar
struts2-tiles-plugin-2.1.6.jar
tiles-servlet-2.1.2.jar
batik-bridge.jar
batik-parser.jar
batik-xml.jar
jasperreports-dejavu-fonts.jar
jfreechart-1.0.0.jar
png-encoder-1.5.jar
commons-digester-1.8.1.jar
displaytag-1.2.jar
freemarker-2.3.8.jar
itext-1.3.1.jar
ognl-2.6.11.jar
spring.jar
tiles-api-2.1.2.jar
xwork-2.0.4.jar
batik-css.jar
batik-script.jar
castor-1.2.jar
JasperReportViewer.jar
jfreechart-1.0.12.jar
poi-3.2-FINAL-20081019.jar
an i am getting the following error.
2009-05-29 12:38:58,078 ERROR (org.apache.commons.digester.Digester:1646) - Parse Error at line 2 column 387: Document root element "jasperReport", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "jasperReport", must match DOCTYPE root "null".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1621)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1900)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:764)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1316)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3095)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:921)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.commons.digester.Digester.parse(Digester.java:1764)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:115)
at com.sufalam.presentation.finance.action.JasperAccountAction.getAccounts(JasperAccountAction.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:517)
at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:931)
at ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:53)
at ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:121)
at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.getProperty(OgnlValueStack.java:58)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
at com.opensymphony.xwork2.util.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:101)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
at ognl.ASTProperty.getValueBody(ASTProperty.java:92)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.Ognl.getValue(Ognl.java:333)
at ognl.Ognl.getValue(Ognl.java:310)
at com.opensymphony.xwork2.util.OgnlUtil.getValue(OgnlUtil.java:190)
at com.opensymphony.xwork2.util.OgnlValueStack.findValue(OgnlValueStack.java:208)
at org.apache.struts2.views.jasperreports.ValueStackDataSource.<init>(ValueStackDataSource.java:59)
at org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:204)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.ap
ache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(Def
aultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
2009-05-29 12:38:58,078 WARN (com.opensymphony.xwork2.util.OgnlValueStack:269) - Caught an exception while evaluating expression 'accounts' against value stack
Caught an Ognl exception while getting property accounts - Class: ognl.OgnlRuntime
File: OgnlRuntime.java
Method: getMethodValue
Line: 935 - ognl/OgnlRuntime.java:935:-1
at com.opensymphony.xwork2.util.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:106)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
at ognl.ASTProperty.getValueBody(ASTProperty.java:92)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
Looks like your JasperReport.xml is simply missing a doctype. Try starting the file this way:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<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="null" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
the field names shold be similar to the account bean's property names
I was facing the same problem, I could fix it just putting the correct field name from my bean
<fieldDescription><![CDATA[correct_name_of_field]]></fieldDescription>, of course in your .jrxml ;)
I was on it for a couple of days.
By the way put all the jars of jasper, apache commons*, poi, itext, jxl.