如何将Grails与BIRT报告一起使用并显示BIRT web查看器

如何将Grails与BIRT报告一起使用并显示BIRT web查看器,grails,grails-plugin,birt,Grails,Grails Plugin,Birt,我在grailsweb应用程序项目上安装了birt报告插件,但我无法理解如何使用它。我有两个用例: 生成BIRT web查看器并在GSP页面上显示(显示图表报告) 将BIRT报告生成为其他文件格式(PDF、Word等) 任何人都可以提供这样做的例子吗?基本上你可以使用插件文档()中提到的例子。 1.用于生成HTML报告。注意到BIRT生成HTML而不是GSP。您可以在GSP页面中呈现输出HTML // generate html output and send it to the browser

我在grailsweb应用程序项目上安装了birt报告插件,但我无法理解如何使用它。我有两个用例:

  • 生成BIRT web查看器并在GSP页面上显示(显示图表报告)
  • 将BIRT报告生成为其他文件格式(PDF、Word等)

  • 任何人都可以提供这样做的例子吗?

    基本上你可以使用插件文档()中提到的例子。 1.用于生成HTML报告。注意到BIRT生成HTML而不是GSP。您可以在GSP页面中呈现输出HTML

    // generate html output and send it to the browser
     def show() {
         String reportName = params.remove('id')
         String reportExt = 'pdf'
         params.remove('action')
         params.remove('controller')
         params.remove('name')
         def options = birtReportService.getRenderOption(request, 'html')
         def result=birtReportService.runAndRender(reportName, params, options)
         response.contentType = 'text/html'
         response.outputStream << result.toByteArray()
         return false
     }
    
    //生成html输出并将其发送到浏览器
    def show(){
    String reportName=params.remove('id')
    字符串reportExt='pdf'
    params.remove('action')
    参数删除('controller')
    params.remove('name')
    def options=birtReportService.getRenderOption(请求'html')
    def result=birtReportService.runandender(报告名、参数、选项)
    response.contentType='text/html'
    
    response.outputStream为什么这个问题受到保护?答案在哪里?