Please start new threads for new topics.

Security Management wrote:
I have put a file here:

/jasper/report.jrxml

Without any context I have no idea where that file is: is it on the classpath? Is it in the webapp root?

<action name="saveReport" class="com.secmgmt.struts2.actions.SaveReport">
                <result name="success" type="jasper">
            <param name="location">/jasper/scrounger_report.jasper</param>
            <param name="dataSource">personList</param>
            <param name="format">PDF</param>
        </result>
</action>

I've also tried:
<param name="location">my-webapp/jasper/scrounger_report.jasper</param>

Which is what the tutorial has.

In my action, I have:
try
            {
                JasperCompileManager.compileReportToFile(
                    "my-webapp/jasper/scrounger_report.jrxml",
                    "my-webapp/jasper/scrounger_report.jasper");

What is "my-webapp"? A directory? Your web app's context? If the latter, that certainly won't work, you'd need to get the path relative to your webapp's deployment.

If compileReportToFile is expecting a physical file you may have issues if you're deploying a war file, since files contained in it may not be accessible in this manner.

Are you actually compiling the report each time the action is hit?

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to