Grails4 整合Ureport2报表

1、build.gradle引入组件

// https://mvnrepository.com/artifact/com.bstek.ureport/ureport2-console
compile group: 'com.bstek.ureport', name: 'ureport2-console', version: '2.2.9'

2、在spring/resources.groovy中注入bean

import com.bstek.ureport.console.UReportServlet
import org.springframework.boot.web.servlet.ServletRegistrationBean

// Place your Spring DSL code here
beans = {
    ureportServlet(ServletRegistrationBean, new UReportServlet(), "/ureport/*")
}

3、启动类上添加 @ImportResource("classpath:ureport-console-context.xml")

@ImportResource("classpath:ureport-console-context.xml")
@CompileStatic
@EnableDiscoveryClient
@EnableFeignClients(basePackages = ["middol.fegin"])
class Application extends GrailsAutoConfiguration {
    static void main(String[] args) {
        GrailsApp.run(Application, args)
    }
}

4、访问 http://localhost:8011/ureport/designer 如下图

设计一个简单的二维表信息

预览一下,效果如下

发布了102 篇原创文章 · 获赞 40 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/qq_16165281/article/details/104663426
今日推荐