开发者

dynamically set column width in DynamicJasper

开发者 https://www.devze.com 2023-01-17 10:39 出处:网络
what I need to do is dynamically set column width: something like ColumnBuilder builder = ColumnBuilder.get开发者_运维技巧New().setWidth(x);

what I need to do is dynamically set column width: something like

ColumnBuilder builder = ColumnBuilder.get开发者_运维技巧New().setWidth(x); 

but I actually don't know what x is when report is build. This "report template" will be used on many different queries and I don't know what will be the length of fields.

If you use builder without setting width, all columns have same width, even if fields in one column have for instance 200 chars and other 1.(i don't want to have 50 newlines in one column)

I am trying to use some kind structure containing max length for each column but i don't like that solution and the code is a little bit nasty:)

Thanks for the help.


You should pass true to setUseFullPageWidth() of the FastReportBuilder class to use the entire page when dynamically setting the column width.

For example:

FastReportBuilder dr = new FastReportBuilder();
dr.setUseFullPageWidth(true);
0

精彩评论

暂无评论...
验证码 换一张
取 消