http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong 
documentation
----------------------------------------------------------------------------------------

                 Key: WW-3094
                 URL: https://issues.apache.org/struts/browse/WW-3094
             Project: Struts 2
          Issue Type: Bug
         Environment: 
http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong 
documentation
            Reporter: Martin Gainty


http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html doc does'nt 
accomodate getRealPath
try {
            JasperCompileManager.compileReportToFile(
                    "S2_WEBAPP/jasper/our_jasper_template.jrxml",
                    "S2_WEBAPP/jasper/our_compiled_template.jasper");
        } catch (Exception e) {
            e.printStackTrace();
            return ERROR;

instead of  "S2_WEBAPP/jasper/our_jasper_template.jrxml"

should be:
StringBuffer 
sb=ServletActionContext.getServletContext().getRealPath("S2_WEBAPP");
//then just tack on your jrxml filename
path1=sb.append("/jasper/scrounger_report.jrxml").toString();
//then just tack on your our_compiled_template.jasper
path2=sb.append("/jasper/our_compiled_template.jasper").toString();

try {
            JasperCompileManager.compileReportToFile(
                   path1,
                   path2;
        } catch (Exception e) {
            e.printStackTrace();
            return ERROR;

HTH
MCG 21 April 2009 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to