NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: How to Create .jar files from jasper project  (Read 390 times)

Luis Montaño

  • Newbie
  • *
  • Posts: 29
    • View Profile
How to Create .jar files from jasper project
« on: February 13, 2019, 01:07:36 am »

Hi everyone,
I have implemented netxms server with sql server 2016 and I have enabled reporting module. At the moment I can execute predefined report "Alarms Resolution time"
Also I have downloaded JasperStudio to create reports and I can view the report properly (On Jasper Studio Console). However, I would like to generate .jar file to integrate it with netxms.
I have seen some recomendation regarding use "maven package" command to generate .jar files. I have installed maven on windows but I realize that need a pom.xml file to make it wok properly.
Anyone  has a quick guide that I can follow?. I have seen that file (pom.xml) on java projects. It does mean that I have to use a java IDE like eclipse and jasper complement?.
What do you think would be the best way to do it?
Logged

Luis Montaño

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: How to Create .jar files from jasper project
« Reply #1 on: February 13, 2019, 01:19:22 am »

Also I think that would be nice if we can have a standard repository/post where all can share their customized reports.
Logged

Alex Kirhenshtein

  • Team Member
  • Administrator
  • Hero Member
  • *****
  • Posts: 916
    • View Profile
Re: How to Create .jar files from jasper project
« Reply #2 on: February 13, 2019, 05:26:17 pm »

I use maven for that (see attached pom.xml).

buildUuid is used to distinguish between different reports, so if you want to see old runs of the report after changing report definition - uuid should remain the same.

Directory structure should be like this:

Code: [Select]
❯ tree
.
├── pom.xml
├── src
│   └── main
│       └── resources
│           ├── i18n.properties
│           └── main.jrxml

Entry point for the report should be main.jrxml, you can use $P{SUBREPORT_DIR} to reference images or subreprots.
Logged

Luis Montaño

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: How to Create .jar files from jasper project
« Reply #3 on: February 13, 2019, 07:11:42 pm »

Thanks, it works perfectly :D
Logged