html - 使用 HTML 标记在 Jasper 中进行文本对齐

标签 html jasper-reports alignment text-alignment

<分区>

我想将静态文本的文本与 html 标记对齐。我试过 p 标签同时具有 align 和 text-align 属性。似乎两者都没有生效。

<p align="right">Right 1</p> <p text-align:right>Right 2</p>

enter image description here

我知道 jasper 报告支持很少的 html 标签根据 http://community.jaspersoft.com/questions/539009/html-tags-supported-jasper-reports-v-371

是否有可能在 japser 版本 6.0.3 上实现这一点?

非常感谢任何帮助。

最佳答案

使用 <textField><textElement markup="html"/>您只能格式化文本的外观。 (颜色、粗体、下划线 ecc)。

此功能用于生成样式文本

Quoting Teodord(碧 Jade 报告人员)

The alignment is not among supported styling because it is not about how text characters look, but about how you lay them out. We cannot change the alignment of text within the same text field element.

但是你可以测试 <hc:html>组件,这将呈现您的图像 html。

注意:这不是正确的 html <p text-align:right>应该是<p style='text-align:right'> , 但不会有任何区别。

关于html - 使用 HTML 标记在 Jasper 中进行文本对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34080183/

相关文章:

jasper-reports - Print When Expression 仅打印组中的最后一个元素

css - 如何使父 div 中的元素垂直居中

html - CSS 让每个网格元素都有不同的高度

css - HTML 'class' 元素属性可以包含换行符吗?

jquery - 全 Angular 问题

html - 在滚动条上反转/更改 Logo

html - @font-face 与 cufon

java - 如何从jsp页面传递2个或多个参数到jasper报告

java - 使用 JavaFX 将 ScrollPane 的内容居中并设置 fitToWidth=false

node.js - 使用 Node-Jasper 包在 Node.js 中生成报告