我在iReport中向下钻取问题

时间:2013-02-28 15:30:49

标签: jasper-reports ireport jasperserver

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

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

超链接目标: 自我

超链接类型: ReportExecution

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

_report: 详细信息

reason_id: $ F {reason_id}

start_date: $ P {start_date}

end_date: $ P {end_date}

当我点击摘要报告中的预览时,我输入了所有参数,然后收到此错误:

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>

1 个答案:

答案 0 :(得分:0)

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