<!--帆软依赖-->
<dependency>
<groupId>com.fr</groupId>
<artifactId>fr-chart</artifactId>
<version>9.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/fr-chart-9.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr</groupId>
<artifactId>fr-core</artifactId>
<version>9.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/fr-core-9.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr</groupId>
<artifactId>fr-datasource</artifactId>
<version>9.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/fr-datasource-9.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr</groupId>
<artifactId>fr-performance</artifactId>
<version>9.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/fr-performance-9.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr</groupId>
<artifactId>fr-platform</artifactId>
<version>9.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/fr-platform-9.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr</groupId>
<artifactId>fr-report</artifactId>
<version>9.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/fr-report-9.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fr</groupId>
<artifactId>fr-third</artifactId>
<version>9.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/fr-third-9.0.jar</systemPath>
</dependency>
<!-- 数据库相关的包-->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/ojdbc14.jar</systemPath>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<version>4.10.6.20151104</version>
</dependency>
<dependency>
<groupId>org.clojars.gzeureka</groupId>
<artifactId>javapns</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.8.11.2</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>net.sf.squirrel-sql.plugins</groupId>
<artifactId>sybase</artifactId>
<version>3.2.2</version>
</dependency>
@SpringBootApplication
@RestController
public class FinereportApplication {
public static void main(String[] args) {
SpringApplication.run(FinereportApplication.class, args);
}
/**
* 验证web服务是否正常
* @return
*/
@GetMapping("/hello")
public String hello(){
return "Hello World!";
}
/**
* 添加Servlet的映射
* @return
*/
@Bean
public ServletRegistrationBean servletRegistrationBean(){
return new ServletRegistrationBean(new ReportServlet(),"/ReportServer");
}
/**
* 设置内置Tomcat运行项目目录
* @return
*/
@Bean
public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer(){
// 设置帆软报表根目录(第三步中获取的绝对路径)
String documentRoot = "D:\FineReport_9.0\WebReport";
return new WebServerFactoryCustomizer<ConfigurableWebServerFactory>() {
@Override
public void customize(ConfigurableWebServerFactory factory) {
if (factory instanceof TomcatServletWebServerFactory) {
TomcatServletWebServerFactory tomcat = (TomcatServletWebServerFactory) factory;
if (!StringUtils.isEmpty(documentRoot)) {
File root = null;
try {
root = ResourceUtils.getFile(documentRoot);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
tomcat.setDocumentRoot(root);
}
}
}
};
}
}