Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails BIRT报告赢得';在birt报告插件中运行时,不打印dataSetRow[“name”值_Grails_Birt - Fatal编程技术网

Grails BIRT报告赢得';在birt报告插件中运行时,不打印dataSetRow[“name”值

Grails BIRT报告赢得';在birt报告插件中运行时,不打印dataSetRow[“name”值,grails,birt,Grails,Birt,我创建了一个简单的BIRT报告,它使用两个不同的数据集从两个DB表中选择数据。它还有两个参数被传递到数据集查询中 我的问题是,当我从Eclipse+BIRT环境运行报告时,它会按其应有的方式获取所有数据,但当我从Grails BIRT报告服务运行报告时,它只打印静态框架,而不打印来自DB的数据 首先,我认为传递给服务的参数值有问题,所以我在报告中添加了一行来打印这些值。参数按其应有的方式传递和打印。 然后我从查询中删除了where部分,但仍然没有发生任何事情。该报告在从Eclipse运行时填写,

我创建了一个简单的BIRT报告,它使用两个不同的数据集从两个DB表中选择数据。它还有两个参数被传递到数据集查询中

我的问题是,当我从Eclipse+BIRT环境运行报告时,它会按其应有的方式获取所有数据,但当我从Grails BIRT报告服务运行报告时,它只打印静态框架,而不打印来自DB的数据

首先,我认为传递给服务的参数值有问题,所以我在报告中添加了一行来打印这些值。参数按其应有的方式传递和打印。
然后我从查询中删除了where部分,但仍然没有发生任何事情。该报告在从Eclipse运行时填写,在birt报告插件中运行时为空

这是我用来打印报告的代码:

    params.remove('action')
    params.remove('controller')
    params.remove('name')

    params.put("userId", 10)   //parameter that should be passed
    params.put("resumeId", 5)  //parameter that should be passed

    println params;

    def options = birtReportService.getRenderOption(request, 'doc')
    def result=birtReportService.runAndRender(reportName, params, options)
    response.setHeader("Content-disposition", "attachment; filename=" +reportName + "."+reportExt);
    response.contentType = 'application/doc'
    response.outputStream << result.toByteArray()
params.remove('action'))
参数删除('controller')
params.remove('name')
put(“userId”,10)//应该传递的参数
params.put(“resumeId”,5)//应该传递的参数
println参数;
def options=birtReportService.getRenderOption(请求“doc”)
def result=birtReportService.runandender(报告名、参数、选项)
response.setHeader(“内容处置”、“附件;文件名=“+reportName+””+reportExt);
response.contentType='application/doc'

我不熟悉Grails,但是。您是否在Grails上显示任何错误?如果你在Grails上运行一个simular报告,它能正常工作吗?@JamesJenkins,没有Grails错误或任何其他错误出现,这是我创建的第一个BIRT报告,因此我无法真正判断其他报告是否能正常工作。我会使用演示数据“经典汽车”创建一个简单的报告。BIRT帮助界面中有教程。然后通过Grail进行测试。这将帮助您确定错误是在BIRT端还是在Grail端(或两者的结合)。因为经典汽车数据在BIRT产品中,所以它绕过了DB连接。@JamesJenkins发现,在Eclipse预览中工作时,它也不会打印任何经典车型。有没有办法在报告中嵌入一个记录器,让它打印出所有的错误?@JamesJenkins,这与我的Grails应用程序有关,因为当我在新创建的Grails应用程序中启动报告时,它可以工作。 [26/03/2013 13:12:36,909] [org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery] [219] ENTRY org.eclipse.birt.data.engine.impl.DataEngineImpl@1ed14cb8 org.eclipse.birt.data.engine.api.querydefn.QueryDefinition@729b6def org.eclipse.birt.data.engine.impl.OdaDataSetAdapter@200ecb05 {org.eclipse.datatools.connectivity.oda.util_consumerResourceIds=org.eclipse.datatools.connectivity.oda.util.ResourceIdentifiers@2b32c5b4, OdaJDBCDriverPassInConnection=Transaction-aware proxy for target Connection from DataSource [org.apache.commons.dbcp.BasicDataSource@39547eb6], HTML_RENDER_CONTEXT=org.eclipse.birt.report.engine.api.HTMLRenderContext@1251c294, org.eclipse.birt.data.query.ResultBufferSize=100} [26/03/2013 13:12:36,909] [org.eclipse.birt.data.engine.impl.DataEngineImpl] [219] PreparedQuery starts up. [26/03/2013 13:12:36,909] [org.eclipse.birt.data.engine.impl.aggregation.AggregateTable] [219] ENTRY [26/03/2013 13:12:36,909] [org.eclipse.birt.data.engine.impl.aggregation.AggregateTable] [219] RETURN [26/03/2013 13:12:36,909] [org.eclipse.birt.data.engine.impl.aggregation.AggregateTable] [219] ENTRY C:\Users\SZAGOR~1\AppData\Local\Temp\DataEngine_517033144_2\ [object Object] [] [26/03/2013 13:12:36,909] [org.eclipse.birt.data.engine.impl.aggregation.AggregateTable] [219] RETURN [26/03/2013 13:12:36,909] [org.eclipse.birt.data.engine.impl.DataEngineImpl] [219] Start to prepare a PreparedQuery. [26/03/2013 13:12:36,909] [org.eclipse.birt.data.engine.impl.aggregation.AggrRegistry] [219] ENTRY 0 -1 true org.eclipse.birt.core.script.ScriptContext@57b32816 [26/03/2013 13:12:36,909] [org.eclipse.birt.data.engine.impl.aggregation.AggrRegistry] [219] RETURN //these lines are suspicious [26/03/2013 13:12:36,909][org.eclipse.birt.data.engine.expression.InvalidExpression] [219] InvalidExpression starts up [26/03/2013 13:12:36,912] [org.eclipse.birt.data.engine.expression.InvalidExpression] [219] InvalidExpression starts up [26/03/2013 13:12:36,912] [org.eclipse.birt.data.engine.impl.GroupBindingColumn] [219] ENTRY null 0 {first_name=org.eclipse.birt.data.engine.api.querydefn.Binding@f6678eba, last_name=org.eclipse.birt.data.engine.api.querydefn.Binding@77fdce94, coalesce(resume.mobile_phone, " - ")=org.eclipse.birt.data.engine.api.querydefn.Binding@9beadc7d} 2013-03-26 12:51:08,352 [http-bio-8080-exec-1] DEBUG impl.PreparedDataSourceQuery - ENTRY org.eclipse.birt.data.engine.impl.DataEngineImpl@79bff971 org.eclipse.birt.data.engine.api.querydefn.QueryDefinition@1799e2e2 org.eclipse.birt.data.engine.impl.OdaDataSetAdapter@1aec9361 {org.eclipse.datatools.connectivity.oda.util_consumerResourceIds=org.eclipse.datatools.connectivity.oda.util.ResourceIdentifiers@21bfd316, OdaJDBCDriverPassInConnection=Transaction-aware proxy for target Connection from DataSource [org.apache.commons.dbcp.BasicDataSource@38bb5aa9], HTML_RENDER_CONTEXT=org.eclipse.birt.report.engine.api.HTMLRenderContext@143d2a58, org.eclipse.birt.data.query.ResultBufferSize=100} 2013-03-26 12:51:08,352 [http-bio-8080-exec-1] DEBUG impl.DataEngineImpl - PreparedQuery starts up. 2013-03-26 12:51:08,352 [http-bio-8080-exec-1] DEBUG aggregation.AggregateTable - ENTRY 2013-03-26 12:51:08,352 [http-bio-8080-exec-1] DEBUG aggregation.AggregateTable - RETURN 2013-03-26 12:51:08,352 [http-bio-8080-exec-1] DEBUG aggregation.AggregateTable - ENTRY C:\Users\SZAGOR~1\AppData\Local\Temp\DataEngine_2042624369_1\ [object Object] [] 2013-03-26 12:51:08,352 [http-bio-8080-exec-1] DEBUG aggregation.AggregateTable - RETURN 2013-03-26 12:51:08,352 [http-bio-8080-exec-1] DEBUG impl.DataEngineImpl - Start to prepare a PreparedQuery. 2013-03-26 12:51:08,362 [http-bio-8080-exec-1] DEBUG aggregation.AggrRegistry - ENTRY 0 -1 true org.eclipse.birt.core.script.ScriptContext@560fc912 2013-03-26 12:51:08,362 [http-bio-8080-exec-1] DEBUG aggregation.AggrRegistry - RETURN // here it's different 2013-03-26 12:51:08,362 [http-bio-8080-exec-1] DEBUG expression.ColumnReferenceExpression - ENTRY first_name 2013-03-26 12:51:08,362 [http-bio-8080-exec-1] DEBUG expression.ColumnReferenceExpression - RETURN 2013-03-26 12:51:08,362 [http-bio-8080-exec-1] DEBUG expression.ColumnReferenceExpression - ENTRY last_name 2013-03-26 12:51:08,362 [http-bio-8080-exec-1] DEBUG expression.ColumnReferenceExpression - RETURN 2013-03-26 12:51:08,362 [http-bio-8080-exec-1] DEBUG expression.ColumnReferenceExpression - ENTRY coalesce(resume.mobile_phone, " - ") 2013-03-26 12:51:08,362 [http-bio-8080-exec-1] DEBUG expression.ColumnReferenceExpression - RETURN 2013-03-26 12:51:08,362 [http-bio-8080-exec-1] DEBUG impl.GroupBindingColumn - ENTRY null 0 {first_name=org.eclipse.birt.data.engine.api.querydefn.Binding@f6678eba, last_name=org.eclipse.birt.data.engine.api.querydefn.Binding@77fdce94, coalesce(resume.mobile_phone, " - ")=org.eclipse.birt.data.engine.api.querydefn.Binding@9beadc7d}