Jump to content
Changes to the Jaspersoft community edition download ×

How to deploy Jasper reports in JBoss Server


Recommended Posts

By: query - query

How to deploy Jasper reports in JBoss Server

2004-06-27 23:02

Iam using ireports 0.3.0 as gui tool for Jasper reports.

There is a problem deploying Jasper reports on JBOSS server.

There is also a file called px being created for each report created

 

Any information regarding the deployment would be highly appreciated.

 

 

By: C-Box - c-box

RE: How to deploy Jasper reports in JBoss Ser

2004-06-28 00:20

Hi,

 

You just have to put all the needed *.jar files of JasperReport into the lib-dir of your JBoss-Dir (e.g. "C:JBossserverdefaultlib")

 

Then point to the Jasper-Jar within your SessionBeanSourceCode with the help of a system-variable (e.g. "System.setProperty("jasper.reports.compile.class.path", "C:\JBoss\server\default\lib\jasperreports-0.5.3.jar");")

 

So I got it to work with JBOSS.

 

hth

C-Box

 

 

By: query - query

Deploying Jasper Reports on JBoss

2004-06-29 23:29

 

Thank U for the response.

We have deployed Jasper Reports in JBOSS Server in the same way mentioned by U.

But when we export report to a HTML file How can we show in the browser.

when the report is being exported the exporting parameter is accepting only the actual path

of the html file

Is there way to mention the relative path of the html file

 

Iam sending here with the code that Iam using

 

// To load the .jasper file:

JasperReport template = JasperManager.loadReport("c://Ireports//reports//abc.jasper");

JasperPrint report = JasperManager.fillReport(template, parameters, conn);

//To show the reoprt, create a JRViewer and stick it in a dialog:

JasperExportManager.exportReportToHtmlFile(report, "c://Ireports//reports//abc.html");

 

 

 

 

By: Ralf Weinand - weinanr

RE: Deploying Jasper Reports on JBoss

2004-07-01 08:31

You can do it the following way.

Get the OUT-Stream of the response object and write the report into this stream without first saving it as a file:

 

JasperPrint jasperPrint =

JasperFillManager.fillReport(

jasperReport,

parameters,

conn

);

 

JRHtmlExporter exporter = new JRHtmlExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, response.getWriter());

 

exporter.exportReport();

 

 

Regards,

Ralf

 

 

By: query - query

RE: How to deploy Jasper reports in JBoss Server

2004-07-02 05:00

Hi Ralf,

Thank U. I have implented the code that U have sent. Now the deployment is working fine.

but a file called nullpx is being created along with the report and gifs r not being displayed.

hope U can help me out in this.

 

Regards,

query

 

 

By: Ralf Weinand - weinanr

RE: How to deploy Jasper reports in JBoss Ser

2004-07-02 07:18

Then you have to extend your code by the following lines:

 

Map imagesMap = new HashMap(); request.getSession().setAttribute("IMAGES_MAP", imagesMap);

 

exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image.jsp?image=");

 

 

 

 

And you have to implement the jsp "image.jsp" as follows:

 

<%@ page import="java.util.*" %>

<%@ page import="java.io.*" %>

 

<%

Map imagesMap = (Map)session.getAttribute("IMAGES_MAP");

 

if (imagesMap != null)

{

String imageName = request.getParameter("image");

if (imageName != null)

{

byte[] imageData = (byte[])imagesMap.get(imageName);

 

response.setContentLength(imageData.length);

ServletOutputStream ouputStream = response.getOutputStream();

ouputStream.write(imageData, 0, imageData.length);

ouputStream.flush();

ouputStream.close();

}

}

%>

 

 

Hope it works for you.

Regards

Ralf

 

 

 

By: query - query

How to check for a report contaning no rows

2004-08-11 01:35

Hi,

Iam using ireports 0.3.0 as gui tool for Jasper reports. How to check whether the report contains

no rows. Is there any function of the classes JasperPrint or JasperReport to verify if there is no data in the report.

I need to send an error message if the report contains no records.

Iam exporting the report to HTML file.

 

Hope someone can help me out in this

 

Regards,

query

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...