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 如下图
设计一个简单的二维表信息
预览一下,效果如下