FIFA oneterahertz
FIFA oneterahertz

Reputation: 720

how to integrate .jrxml files to a project in eclipse

I have approximately 5 jrxml files and many jsp files in a project.Now i have to integrate jrxml files to a project present in eclipse.

Now, how to integrate jrxml files to eclipse so that it should be directory independant (it should not be like this eg:-D:/dev/tools/jasper files/report11.jrxml)?

The second question is we have to include both .jrxml and .jasper files?

The third question is "if we open the project which is present in eclipse in another person PC by pasting this url (http://192.1.168.201:8080/SalesProject/) in other person PC it should run normally and should run jrxml files and should display the data in different formats (eg:-PDF,DOC,XLS,XLSX)

Upvotes: 1

Views: 3299

Answers (1)

Petter Friberg
Petter Friberg

Reputation: 21710

  1. Where to put them? In a folder that is deployed on server as you do with your jsp, images web-inf ecc.

  2. Do I need both .jrxml and .jasper?, No .jasper is enough (note: naturally in your server code you should not compile the .jrxml files anymore). To make it easier to understand a comparisons with java would be .jrxml = .java and .jasper = .class

  3. Will it work? Sure since they are deployed on the server you only need to figure out how to reference them correctly from your .jsf page (search some one the web or on SO, there are a lot of answers) ...

    ServletContext context = request.getServletContext(); 
    String fullPath = context.getRealPath("/WEB-INF/reports/your_report.jasper");
    

Upvotes: 1

Related Questions