Desktop version

Home arrow Computer Science arrow Building Applications with Scala

Source

Integrating JasperReports with Play framework

We will need to create a new folder under ReactiveWebStore/app called reports. Then, we will copy all three new .jrxml files from the Jaspersoft Studio to this folder and set up the build dependencies.

build.sbt

First of all, we will need to add new dependencies to the build.sbt file.

Your build.sbt file should look like this after adding the Jasper dependencies:

libraryDependencies ++= Seq(

// .... Other dependencies ....

"net.sf.jasperreports" % "jasperreports" % "6.2.2" withSources() ,"net.sf.jasperreports" % "jasperreports-functions" % "6.2.2", "net.sf.jasperreports" % "jasperreports-chart-themes" % "6.2.2"

)

resolvers += "Jasper" at

"https://jaspersoft.artifactoryonline.com/jaspersoft/repo/" resolvers += "JasperSoft" at

"https://jaspersoft.artifactoryonline.com/jaspersoft/jaspersoft-

repo/"

resolvers += "Jasper3rd" at

"https://jaspersoft.artifactoryonline.com/jaspersoft/

jaspersoft-3rd-party/"

resolvers += "mondrian-repo-cache" at

"https://jaspersoft.artifactoryonline.com/jaspersoft/

mondrian-repo-cache/"

resolvers += "spring-mil" at "http://repo.spring.io/libs-milestone" resolvers += "spring-rel" at "http://repo.spring.io/libs-release" resolvers += "oss" at

"https://oss.sonatype.org/content/groups/public/"

So, basically, we added all JasperReports dependencies and resolvers, which are a bunch of remote repositories where SBT can look for the jar files. You can run the $ activator compile command on the console in order to reload the new dependencies. After running compile, it is important to generate eclipse files again, so you will need to run $

activator eclipse.

 
Source
Found a mistake? Please highlight the word and press Shift + Enter  
< Prev   CONTENTS   Next >

Related topics