【发布时间】:2016-09-16 05:26:35
【问题描述】:
我使用传递单值参数的 oracle 查询设计了 HTML 图表,它运行良好。我使用了将HTML Chart放在Summary band中的方法,并将Evalution time设置为Now,效果很好。
现在我想使用多值参数显示相同的HTML chart。我想在每个 pdf 页面中显示每个项目的图表元素。因此,从逻辑上讲,我需要将HTML chart 放在Detail band 而不是Summary band。但是现在它不起作用并抛出错误“incrementing bidimensional dataset”
仅供参考,我将此图表报告用作另一个主报告的子报告。
Jaspersoft studio 版本:5.6.1 最终版
<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="Charts" pageWidth="200" pageHeight="275" orientation="Landscape" columnWidth="200" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="c6523df6-0c5f-4728-87c2-57825f88fca3">
<property name="com.jaspersoft.studio.unit." value="inch" />
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel" />
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel" />
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel" />
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel" />
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel" />
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel" />
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel" />
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Dev DB Conn" />
<parameter name="param_month" class="java.lang.String" />
<parameter name="param_year" class="java.lang.String" />
<parameter name="param_project" class="java.util.Collection" />
<queryString language="SQL">
<![CDATA[SELECT
i.id prid,c.INUSAGE,d.CURRUSAGE
FROM
project table i, custom table c
where i.id = c.id and $X{IN,I.id,param_project}
]]>
</queryString>
<field name="prid" class="java.math.BigDecimal" />
<field name="INUSAGE" class="java.math.BigDecimal" />
<field name="CURRUSAGE" class="java.math.BigDecimal" />
<summary>
<band height="223">
<componentElement>
<reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="3" width="190" height="220" uuid="0a0e6b98-2d59-453a-8642-3a65d4b30bb1">
<property name="local_mesure_unitwidth" value="inch" />
</reportElement>
<hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="Column" evaluationGroup="">
<hc:chartSetting name="default">
<hc:chartProperty name="_showDataPoints">
<hc:propertyExpression>
<![CDATA[Boolean.FALSE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="_showMeasureNameOnValueAxis">
<hc:propertyExpression>
<![CDATA[Boolean.FALSE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.alignTicks">
<hc:propertyExpression>
<![CDATA[Boolean.FALSE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.animation">
<hc:propertyExpression>
<![CDATA[Boolean.TRUE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.borderRadius">
<hc:propertyExpression>
<![CDATA[new Integer(0)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.borderWidth">
<hc:propertyExpression>
<![CDATA[new Integer(0)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.ignoreHiddenSeries">
<hc:propertyExpression>
<![CDATA[Boolean.FALSE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.selectionMarkerFill">
<hc:propertyExpression>
<![CDATA[new java.awt.Color(-1)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.shadow">
<hc:propertyExpression>
<![CDATA[Boolean.FALSE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.spacingBottom">
<hc:propertyExpression>
<![CDATA[new Integer(20)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.zoomType">
<hc:propertyExpression>
<![CDATA["none"]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="colors">
<hc:propertyExpression>
<![CDATA[java.util.Arrays.asList("#779499","#C0D9DE","#8bbc21","#910000","#1aadce","#492970","#f28f43","#77a1e5","#c42525","#a6c96a","#C0D9DE")]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.enabled">
<hc:propertyExpression>
<![CDATA[false]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.href">
<hc:propertyExpression>
<![CDATA[""]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.text">
<hc:propertyExpression>
<![CDATA[""]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.align">
<hc:propertyExpression>
<![CDATA["center"]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.borderRadius">
<hc:propertyExpression>
<![CDATA[new Integer(5)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.enabled">
<hc:propertyExpression>
<![CDATA[Boolean.TRUE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.floating">
<hc:propertyExpression>
<![CDATA[Boolean.FALSE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.layout">
<hc:propertyExpression>
<![CDATA["horizontal"]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.lineHeight">
<hc:propertyExpression>
<![CDATA[new Integer(30)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.margin">
<hc:propertyExpression>
<![CDATA[new Integer(15)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.padding">
<hc:propertyExpression>
<![CDATA[new Integer(8)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.symbolPadding">
<hc:propertyExpression>
<![CDATA[new Integer(5)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.symbolWidth">
<hc:propertyExpression>
<![CDATA[new Integer(30)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.verticalAlign">
<hc:propertyExpression>
<![CDATA["bottom"]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.x">
<hc:propertyExpression>
<![CDATA[new Integer(10)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legend.y">
<hc:propertyExpression>
<![CDATA[new Integer(10)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="legened.itemStyle.fontSize" value="4" />
<hc:chartProperty name="plotOptions.series.animation">
<hc:propertyExpression>
<![CDATA[Boolean.TRUE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="plotOptions.series.dataLabels.enabled" value="true" />
<hc:chartProperty name="plotOptions.series.dataLabels.format" value="{point.y:,.0f}" />
<hc:chartProperty name="plotOptions.series.lineWidth">
<hc:propertyExpression>
<![CDATA[new Integer(2)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="plotOptions.series.shadow">
<hc:propertyExpression>
<![CDATA[Boolean.TRUE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="plotOptions.series.showInLegend">
<hc:propertyExpression>
<![CDATA[Boolean.TRUE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="plotOptions.series.visible">
<hc:propertyExpression>
<![CDATA[Boolean.TRUE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="title.align">
<hc:propertyExpression>
<![CDATA["left"]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="title.style.color">
<hc:propertyExpression>
<![CDATA[new java.awt.Color(-4138530)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="title.text">
<hc:propertyExpression>
<![CDATA[""]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="title.verticalAlign">
<hc:propertyExpression>
<![CDATA["top"]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="tooltip.animation">
<hc:propertyExpression>
<![CDATA[Boolean.TRUE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="tooltip.enabled">
<hc:propertyExpression>
<![CDATA[Boolean.TRUE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="tooltip.shadow">
<hc:propertyExpression>
<![CDATA[Boolean.TRUE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="xAxis.labels.step">
<hc:propertyExpression>
<![CDATA[new Integer(0)]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="yAxis.gridLineColor" value="'#FFFFFF'" />
<hc:chartProperty name="plotOptions.column.marker.enabled">
<hc:propertyExpression>
<![CDATA[Boolean.FALSE]]>
</hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="yAxis.title.text" value="" />
</hc:chartSetting>
<multiAxisData>
<multiAxisDataset />
<dataAxis axis="Rows">
<axisLevel name="InvName">
<labelExpression>
<![CDATA[]]>
</labelExpression>
<axisLevelBucket class="java.lang.String">
<bucketExpression>
<![CDATA[]]>
</bucketExpression>
</axisLevelBucket>
</axisLevel>
</dataAxis>
<dataAxis axis="Columns" />
<multiAxisMeasure name="Initial Baseline" class="java.lang.Integer" calculation="Highest">
<labelExpression>
<![CDATA["Initial Baseline"]]>
</labelExpression>
<valueExpression>
<![CDATA[$F{INUSAGE}]]>
</valueExpression>
</multiAxisMeasure>
<multiAxisMeasure name="Current Baseline" class="java.lang.Integer" calculation="Highest">
<labelExpression>
<![CDATA["Current Baseline"]]>
</labelExpression>
<valueExpression>
<![CDATA[$F{CURRUSAGE}]]>
</valueExpression>
</multiAxisMeasure>
</multiAxisData>
<hc:series name="Current Baseline" />
<hc:series name="Initial Baseline" />
</hc:chart>
</componentElement>
</band>
</summary>
谢谢
【问题讨论】:
-
Hence Logically I need to place the HTML chart at Detail band.不正确。如果您只是想在折线图中添加“更多线”,这不取决于详细信息带,而是取决于您的 SQL 和元素的配置。 -
您好,感谢您的回复。我希望在每个 pdf 页面中显示每个项目的条形图。因此,我试图将图表放在细节带中,这将使我得到这个结果。我在这里做错了吗?我还在查询中添加了代码 $X{IN,tablecolumn,param_name} 以获得结果。结果适用于所有文本和静态结果。只有图表有问题。请提供任何解决方法
-
SO 不是服务,而是社区。请不要询问“尽快提供帮助”和“提供任何解决方法”。如果可以理解这个案例,这就是我们想要做的。因此:请edit您的问题,添加 jrxml 和有关行为的屏幕截图。
-
我已经为包含在摘要带中的 HTML 图表添加了 jrxml 代码。当我将图表从 Sumamry 移动到详细信息或组标题时,它会抛出错误“net.sf.jasperreports.engine.JRException:net.sf.jasperreports.engine.JRRuntimeException:增加二维数据集时出错”
标签: html charts jasper-reports