【问题标题】:wrap text on cell with BIRT report exported to PDF使用导出为 PDF 的 BIRT 报告在单元格上换行
【发布时间】:2018-08-09 23:40:25
【问题描述】:

我有下一个问题,我需要在这个单元格上包装这个文本,但是看起来被裁剪了

示例: click here

但全文为:0123456789ABCDEFGH 并且只显示:0123456789ABCD

如何将文本包装在单元格上?我在 Eclipse Neon 上使用 BIRT Report 4.6

【问题讨论】:

    标签: eclipse reporting birt


    【解决方案1】:

    基于: http://developer.actuate.com/community/forum/index.php?/topic/19827-how-do-i-use-word-wrap-in-report-design/?s=173b4ad992e47395e2c8b9070c2d3cce

    如果您正在使用资源,请在其中添加此功能。如果没有,您可以复制并使用函数内的代码。

    变量 longStr 是你想要包装的长字符串 (0123456789ABCDEFGH) width 是您要为字符串授权的大小,因此对您来说是 15。

    /** 
    * Format a long String to be smaller and be entirely showed
    *
    *@param longStr 
    *             the String to split
    *@param width
    *               the character number that the string should be 
    *
    *@returns the string splited
    */
    function wrap(longStr,width){ 
        length = longStr.length; 
        if(length <= width) 
            return longStr; 
        return (longStr.substring(0, width) + "\n" + wrap(longStr.substring(width, length), width)); 
     } 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-14
      • 1970-01-01
      • 2018-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多