如何调试碧玉报道? [英] How to debug jasper reports?

查看:109
本文介绍了如何调试碧玉报道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在使用iReport进行设计研究。在某些条件下,碧玉陷入某种无限循环/递归调用。 Jasper的日志重复:

Currently i am working on my first reports using iReport for design. Under certain conditions jasper gets stuck in some kind of infinte loop / recursive call. Jasper's logs following repeatedly:

[...]
12-04-10 10:29:59,222 DEBUG s.engine.fill.JRVerticalFiller|Fill 1207280802: page footer
12-04-10 10:29:59,222 DEBUG ports.engine.fill.JRBaseFiller|Fill 1207280802: adding page 38849
12-04-10 10:29:59,222 DEBUG ts.engine.fill.JRFillSubreport|Fill 1207280802: resuming 849817670
12-04-10 10:29:59,222 DEBUG e.fill.JRThreadSubreportRunner|Fill 849817670: notifying to continue
12-04-10 10:29:59,222 DEBUG e.fill.JRThreadSubreportRunner|Fill 849817670: waiting for fill result
12-04-10 10:29:59,222 DEBUG e.fill.JRThreadSubreportRunner|Fill 849817670: notified to continue
12-04-10 10:29:59,222 DEBUG ports.engine.fill.JRBaseFiller|Fill 849817670: suspeding subreport runner
12-04-10 10:29:59,222 DEBUG e.fill.JRThreadSubreportRunner|Fill 849817670: notifying on suspend
12-04-10 10:29:59,222 DEBUG e.fill.JRThreadSubreportRunner|Fill 849817670: waiting to continue
12-04-10 10:29:59,222 DEBUG e.fill.JRThreadSubreportRunner|Fill 849817670: notified of fill result
12-04-10 10:29:59,222 DEBUG ts.engine.fill.JRFillSubreport|Fill 1207280802: subreport 849817670 to continue
[...]

使用相同的填充ids重复记录此序列。我在解释这些调试日志时遇到困难。除了解决具体问题,我对调试碧玉报告的策略感兴趣。那么你如何调试报告?

This sequence is logged repeatedly with identical filler ids. I have difficulties with interpreting those debug logs. Apart from solving the concrete problem i am interested in strategies to debug jasper reports. So, how do you debug reports?

推荐答案

你可以使用 log4j.properties 从iReport获取一些附加信息。以下步骤由Jasper支持提供给我,以帮助我了解一个报表生成了几个子报表,并在它们之间传递动态SQL。

You can use the log4j.properties to get some additional information from iReport. The below steps were provided to me by Jasper support to help me see what SQL was being generated by a report with several sub reports and dynamic SQL being passed between them.


  1. 创建一个 log4j.properties 文件(将其放在 ireport / etc ),
    内容如下:

  1. Create a log4j.properties file (place it under ireport/etc), with the contents as follows:

#############################################
log4j.appender.fileout=org.apache.log4j.RollingFileAppender
log4j.appender.fileout.File=C:/tmp/iReport.log
log4j.appender.fileout.MaxFileSize=1024KB
log4j.appender.fileout.MaxBackupIndex=1
log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
log4j.appender.fileout.layout.conversionPattern=%d{ABSOLUTE} %5p
%c{1},%t:%L - %m%n
log4j.rootLogger=warn, fileout
log4j.logger.net.sf.jasperreports.engine.query=debug
#############################################

如上所述,输出日志将位于 iReport.log c:/ tmp
文件夹。

With the above, the output log will be in the iReport.log in the c:/tmp folder.

编辑 ireport / etc / ireportpro.conf 并在
<$ c中添加以下内容$ c> default_options 参数:

-J-Dlog4j.configuration=file:/E:/Server/Server451/ireport/etc/log4j.properties

所以成为:

default_options="-J-Xms24m -J-Xmx512m

-J-Dorg.netbeans.ProxyClassLoader.level=1000 -J-XX:MaxPermSize=256m
-J-Dlog4j.configuration=file:/E:/Server/Server451/ireport/etc/log4j.properties"

请注意上述目录,您将需要将其调整为
您自己的iReport安装的具体目录。

Please pay attention to the above directory, you will need to adjust it to your own specific directory of iReport installation.

重新启动iReport并执行报告,生成的SQL将在$ code> iReport.log 中输出

Restart iReport and execute reports, the generated SQL will then be output in iReport.log.

这篇关于如何调试碧玉报道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆