Jump to content
JasperReports Library 7.0 is now available ×

Help about JasperPrint


2004 IR Help

Recommended Posts

By: rod - rodrigofil

Help about JasperPrint

2005-07-05 04:44

I have the next source code

 

try

{

jasperReport = JasperManager.loadReport("C:\Sun\AppServer\samples\quickstart\build\prueba.jasper");

 

catch (JRException ex)

{

%>

<p>Exception 1</p>

<%=ex%>

<%

}

 

 

try

{

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JREmptyDataSource());

}

catch (JRException ex)

{

%>

<p>Exception 2</p>

<%=ex%>

<%

}

 

When I execute it i only obtain the next exception:

 

net.sf.jasperreports.engine.JRException: Error loading expression class : prueba

 

in the line

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JREmptyDataSource());

 

where prueba is my report file named prueba.jasper

 

I need some help about this problem

 

Thanks

 

 

 

 

By: Radha - radharani

RE: Help about JasperPrint

2005-07-05 04:55

Hi,

 

Use JRLoader.loadObject() to load the jasper report.

 

Regds

 

 

 

 

By: rod - rodrigofil

RE: Help about JasperPrint

2005-07-05 05:08

Thanks, but and then ...

 

Which are the next instructions??

 

 

 

 

By: Radha - radharani

RE: Help about JasperPrint

2005-07-05 05:16

Use

 

try

{

jasperReport = (JasperReport) JRLoader.loadObject("C:\Sun\AppServer\samples\quickstart\build\prueba.jasper");

 

catch (JRException ex)

{

%>

<p>Exception 1</p>

<%=ex%>

<%

}

 

to load the file and use

 

try

{

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JREmptyDataSource());

}

catch (JRException ex)

{

%>

<p>Exception 2</p>

<%=ex%>

<%

}

 

to get the JasperPrint.

 

Once you get the JasperPrint you can use the exporter like JRHtmlExporter to export it.

 

 

 

 

By: Radha - radharani

RE: Help about JasperPrint

2005-07-05 05:51

Try Using this

 

try

{

File reportFile = new File("C:\Sun\AppServer\samples\quickstart\build\prueba.jasper");

jasperReport = (JasperReport) JRLoader.loadObject(reportFile.getPath());

 

catch (JRException ex)

{

%>

<p>Exception 1</p>

<%=ex%>

<%

}

 

to load the file and use

 

try

{

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JREmptyDataSource());

}

catch (JRException ex)

{

%>

<p>Exception 2</p>

<%=ex%>

<%

}

 

to get the JasperPrint.

 

Once you get the JasperPrint you can use the exporter like JRHtmlExporter to export it.

 

Regds

 

 

 

 

By: rod - rodrigofil

RE: Help about JasperPrint

2005-07-05 05:45

I have the same problem with the new source code

 

 

 

 

By: rod - rodrigofil

RE: Help about JasperPrint

2005-07-05 23:50

I am working with a server by Sun and in its webpage they say that we need write a line in the server.policy

 

The line is

 

grant {

permission java.lang.RuntimePermission "createClassLoader";

 

Is that line the solution?

 

In other words, could I have a sample of code to create a pdf with Jasper (a minimal sample, without access to a data base, for example a hello world example)

 

Thanks

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...