1
votes

I have two reports: Summary and Detail. They are both located in the same directory and I am trying to do this stuff in iReport 5.0.1. I am trying to make a field in my Summary report so that I can click on it and it will run and show the Detail report. The field is: $F{reason_id}.

In the Summary report I created a hyperlink in one of my fields like so:

Hyperlink target: Self

Hyperlink type: ReportExecution

In my Link parameters I have the parameters:

_report: detail

reason_id: $F{reason_id}

start_date: $P{start_date}

end_date: $P{end_date}

When I click Preview in my Summary report, I enter all my parameters, then I get this error:

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...

What is going on here and how do I fix it?

Edit:

<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

1 Answers

0
votes

Change your report expression to the full path, such as "/reports/folder/detail" and make sure you include the quotation marks around the report name!