1

我有两个报告:SummaryDetail。它们都位于同一个目录中,我正在尝试在 iReport 5.0.1 中执行此操作。我正在尝试在我的摘要报告中创建一个字段,以便我可以单击它,它将运行并显示详细报告。该字段是:$F{reason_id}

在摘要报告中,我在其中一个字段中创建了一个超链接,如下所示:

超链接目标: 自我

超链接类型: ReportExecution

在我的链接参数中,我有以下参数:

_report: 详细信息

reason_id: $F{reason_id}

开始日期: $P{开始日期}

结束日期: $P{结束日期}

当我在摘要报告中单击预览时,我输入了所有参数,然后出现此错误:

Error filling print... Error evaluating expression : 
    Source text : detail
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : 
    Source text : detail 
    at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:203) 
    at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591) 
    at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559) 
    at net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper.evaluateHyperlinkParameters(JRFillHyperlinkHelper.java:82) 
    at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:504) 
    at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:431) 
    at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:259) 
    at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:459) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2044) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:778) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:288) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:151) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:822) 
    at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:61) 
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446) 
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:276) 
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:745) 
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:891) 
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) 
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 
Caused by: groovy.lang.MissingPropertyException: No such property: nrt_detail for class: Sample_1362063546538_723686 
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49) 
    at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:86) 
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:239) 
    at Sample_1362063546538_723686.evaluate(calculator_Sample_1362063546538_723686:229) 
    at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:190) 
    ... 20 more 
Print not filled. Try to use an EmptyDataSource...

这是怎么回事,我该如何解决?

编辑:

<detail>
    <band height="20" splitType="Stretch">
        <textField isBlankWhenNull="true" hyperlinkType="ReportExecution">
            <reportElement uuid="39530e77-e079-4f4b-9533-a8f7c1a1b17d" x="0" y="0" width="100" height="20"/>
            <box leftPadding="1">
                <pen lineWidth="0.5"/>
                <topPen lineWidth="0.5"/>
                <leftPen lineWidth="0.5"/>
                <bottomPen lineWidth="0.5"/>
                <rightPen lineWidth="0.5"/>
            </box>
            <textElement/>
            <textFieldExpression><![CDATA[$F{reason_id}]]></textFieldExpression>
            <hyperlinkParameter name="_report">
                <hyperlinkParameterExpression><![CDATA["C:/JasperReports/detail"]]></hyperlinkParameterExpression>
            </hyperlinkParameter>
            <hyperlinkParameter name="reason_id">
                <hyperlinkParameterExpression><![CDATA[$F{reason_id}]]></hyperlinkParameterExpression>
            </hyperlinkParameter>
            <hyperlinkParameter name="start_date">
                <hyperlinkParameterExpression><![CDATA[$P{start_date}]]></hyperlinkParameterExpression>
            </hyperlinkParameter>
            <hyperlinkParameter name="end_date">
                <hyperlinkParameterExpression><![CDATA[$P{end_date}]]></hyperlinkParameterExpression>
            </hyperlinkParameter>
        </textField>
    </band>
</detail>
4

1 回答 1

0

将您的报告表达式更改为完整路径,例如“/reports/folder/detail”,并确保在报告名称周围包含引号!

于 2013-02-28T16:19:00.643 回答