---
title: "苦不堪言,iReport ＋ JasperReports项目中的历练"
author: "cuiyi.crazy"
date: "2007-07-27T04:19:00Z"
tags: []
slug: "ireport-jasperreports"
draft: false
lastmod: "2007-07-27T04:19:00Z"
id: 106267
url: "https://cuiyi.iteye.com/blog/106267"
---

JasperReports 这个东西，是个好东西，iReport这个东西，也是个好东西；就是iReport这个东西，给我很多启示，关于sql组件，虽最终未必可行，目前处于验证进程。

话说使用iReport＋JasperReports开发报表的曾经的尴尬，testing during development and testing on local machine, the report pdf displays well, so good job have done, but when demo in customer locale, a lot of fields cannot be displayed（不能显示了！）。

After a lot of time trying, almost every  options  supplied  have been tried in checked way and unchecked way, the well fields displayed accordingly, I have got some ideas:

1\) cannot display(不能显示), but other field with same content can display , why?  
    OK, the size is too small(把字符框的 大小设置大一些)，then well done.、

2）some field cannot display  
     process: I found these undisplayed is  in header,  then I copy them to footer,  what's the result? display well in footer, but no display in header.  
     then I change the "evaluation time" from "now" to "column"  
     well done!  
    but be careful, fields valued $F cannot be column, for it cannot be displayed

3\) some field cannot be display  corresponding to  2)  
    why they cannot be displayed  in both  header and  footer?  
    oh, I found most field have the "stretch with overflow" option checked, so I added, so cool

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\**  
this problem I found explation when I solved on net

#### iReport stretch 选项的注意

Text Field有一选项为Stretch with overflow。 作用是动态的伸展文字所占的空间。

要注意一点是Stretch是跟据Font Name的体字像数为基准进行伸展的。所以当我们输出PDF格式时要注意PDF Font Name 与Font Name是否一致。如不一致在文字量多的时候会出现少了或多了显示空间的问题

#### iReport Band的\[Split allowed]属性

Split allowed是允许分开的意思。以页为单位，被分离出去的是Band内的所有内容。如果剩下的页面空间不够显示Band的内容。那么Band的内容会显示在下一页。

ireport有时侯不能显示数据库中数据的解决方式:  
  1)每一个element:设置:print when details overflow ;stretch overflow  
  2)字段高度不够  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\**  
all resolved, the boss smiled, and happy back from customer  
      
   

![](http://www.blogjava.net/crazycy/aggbug/132740.html)

[crazycy](http://www.blogjava.net/crazycy/) 2007-07-27 12:19 [发表评论](http://www.blogjava.net/crazycy/archive/2007/07/27/132740.html#Feedback)