OK, I took a smart pill, and put the following in my action:

JasperCompileManager.compileReportToFile(
 
this.getServletContext().getRealPath("/jasper/scrounger_report.jrxml"),
 
this.getServletContext().getRealPath("/jasper/scrounger_report.jasper"));

I'm logging that location with log4j, and will have to figure out how to put
it in the struts.xml file for the action.

Thanks for all the help.

-----Original Message-----
From: Balwinder Kumar [mailto:balwinder....@gmail.com] 
Sent: Tuesday, April 21, 2009 10:51 PM
To: Struts Users Mailing List
Subject: Re: Jasper Plugin cannot find file

I would suggest that first give the complete absolute path and check if 
the program is working fine, just to ensure, there is a problem with 
path only.

Once established problem is with path only, I may help you further.

Regards,
Balwinder Kumar

Security Management wrote:
> I'm using the tutorial here:
> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html
>
> I have put a file here:
>
> /jasper/report.jrxml
>
> I can look in my war file and verify it.
>
> I'm trying to compile and render with it.  Here is my action code:
>
> <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");
>             }
>             catch (Exception e)
>             {
>                 e.printStackTrace();
>                 return ERROR;
>             }
>
> But I always get a file not found error, I've tried just the
> /jasper/...jrxml too, without the appname (which I think is the correct
way)
> but no luck.
>
> What path should I be using if the file is in
/jasper/scrounger_report.jrxml
> in my war file?
>
> Thanks
> -----Original Message-----
> From: stanl...@gmail.com [mailto:stanl...@gmail.com] 
> Sent: Tuesday, April 21, 2009 2:29 PM
> To: Struts Users Mailing List
> Subject: Re: How to do matematical operation in jsp.
>
> Nice reference Wes!  BTW, I noticed you are not using the new cover letter
> for the TPS reports, so I'm going to have to go ahead and ask you to read
> that memo one more time.
>
> Peace,
> the Bob's
>
> On Tue, Apr 21, 2009 at 11:11 AM, Wes Wannemacher <w...@wantii.com> wrote:
>
>   
>> [snip]
>>     
>>> OTOH, siphoning the $.0000000000000039079850466805510222911834716796875
>>>       
>> into
>>     
>>> offshore accounts will eventually make you rich.
>>>
>>> Dave "Expecting his 10% cut" Newton
>>>
>>>       
>> [/snip]
>>
>> But, you have to be careful when moving the money into your own
account...
>>
>> [quote]
>> We're not just talking about while-collar, resort prison, we're
>> talking Federal Pound Me In the *** Prison!
>> [/quote]
>>
>> You have to be especially careful of mundane details like decimal places.
>>
>> -Wes
>>
>> --
>> Wes Wannemacher
>> Author - Struts 2 In Practice
>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>> http://www.manning.com/wannemacher
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>   



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

Reply via email to