You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniel Chacón Sánchez <da...@gmail.com> on 2007/10/09 16:29:20 UTC

JaspertReports Struts Problem

Hi all,

I have a strange problem using JasperReports, actually I´m using JDeveloper
10g and JasperReport 1.2.8.

The problem start to appears without a reason, at least I don´t see a reason
for it.

I use this for load my jasperReport from my application:

                //Parameters:
                param.put("NAME",
                          String.valueOf(carne.getName()));
                param.put("LASTNAME",
                         carne.getLastName().toString());

....


               ServletContext context = session.getServletContext();

               File reportFile = new File(context.getRealPath
("/WEB-INF/reportes/carne.jasper"));

               InputStream report = new FileInputStream(reportFile);

               JasperPrint jp = JasperFillManager.fillReport(report, param,
new JREmptyDataSource());

               ....

I know that the reportFile its ok, because if I put a different direction on
it, it throws a not found exception. The problem is with the method
fillReport, now it dowsn´t works, the exception that I recivied is this one:

JRException with the message: Error loading object from InputStream, I know
that is not a version problem beacause I use IReports 1.2.8, like I said,
all worked fine but suddenly not.

Thanks for your help

Re: JaspertReports Struts Problem

Posted by Daniel Chacón Sánchez <da...@gmail.com>.
Anybody?

2007/10/9, Daniel Chacón Sánchez <da...@gmail.com>:
>
> Hi all,
>
> I have a strange problem using JasperReports, actually I´m using
> JDeveloper 10g and JasperReport 1.2.8.
>
> The problem start to appears without a reason, at least I don´t see a
> reason for it.
>
> I use this for load my jasperReport from my application:
>
>                 //Parameters:
>                 param.put("NAME",
>                           String.valueOf(carne.getName()));
>                 param.put("LASTNAME",
>                          carne.getLastName().toString());
>
> ....
>
>
>                ServletContext context = session.getServletContext();
>
>                File reportFile = new File(context.getRealPath("/WEB-INF/reportes/carne.jasper"));
>
>                InputStream report = new FileInputStream(reportFile);
>
>                JasperPrint jp = JasperFillManager.fillReport (report,
> param, new JREmptyDataSource());
>
>                ....
>
> I know that the reportFile its ok, because if I put a different direction
> on it, it throws a not found exception. The problem is with the method
> fillReport, now it dowsn´t works, the exception that I recivied is this one:
>
>
> JRException with the message: Error loading object from InputStream, I
> know that is not a version problem beacause I use IReports 1.2.8 , like I
> said, all worked fine but suddenly not.
>
> Thanks for your help
>
>
>
>
>
>