You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Dave Newton (JIRA)" <ji...@apache.org> on 2009/04/21 23:20:06 UTC

[jira] Updated: (WW-3094) http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation

     [ https://issues.apache.org/struts/browse/WW-3094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Newton updated WW-3094:
----------------------------

    Component/s: Documentation

> 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
>          Components: Documentation
>         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.