Aligning bullets in JasperReports

此生再无相见时 提交于 2019-12-13 19:42:28

问题


The following post answers that bullets can have a hanging indent / be aligned by adding left-padding.

Jasper Report HTML bullet hanging indent

However, when I tried to do that, the whole line would move and so the bullets would no longer be padded

So the text:

- TEXT TEXT TEXT
TEXT TEXT TEXT

would become:

    - TEXT TEXT TEXT
    TEXT TEXT TEXT

when what I want is:

- TEXT TEXT TEXT
  TEXT TEXT TEXT

How can I line up the second line of the bullets. Is there a hanging indent/first line indent that accepts negative numbers, or any other method that I could do this?


回答1:


After playing around a bit I found that what I could do was add padding to the whole paragraph and make the first line a negative indent.

I am using an api called dynamic reports so the way I did it was

TextColumnBuilder<String> itemBulletsCol = col.column(
    "", COLUMN_NAME_BULLET_LIST, type.stringType()
).setStyle(....
        .setFirstLineIndent(-10)
        .setPadding(10)
);


来源:https://stackoverflow.com/questions/16281530/aligning-bullets-in-jasperreports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!