简体   繁体   English

DynamicJasper:如何为globalFooterVariable设置样式?

[英]DynamicJasper: How to set style for globalFooterVariable?

Here is my code which provides sum of columns in footer . 这是我的代码,它在footer中提供列总和

drb.addGlobalFooterVariable(totalAmount, DJCalculation.SUM);
drb.addGlobalFooterVariable(basicAmount, DJCalculation.SUM);
drb.addGlobalFooterVariable(cgstColumn, DJCalculation.SUM);
drb.addGlobalFooterVariable(sgstColumn, DJCalculation.SUM);

But i don't know how to add styles to these footer variables. 但是我不知道如何为这些页脚变量添加样式 Also is it possible to resize fonts of entire report? 还可以调整整个报告的字体大小吗?

Add styles in footer variables 在页脚变量中添加样式

Style style = new StyleBuilder(false).setFont(Font.ARIAL_SMALL)
         .setHorizontalAlign(HorizontalAlign.RIGHT).setBorderBottom(Border.THIN())
         .setVerticalAlign(VerticalAlign.MIDDLE)
         .setPadding(new Integer(0))
         .setStretchWithOverflow(false)
         .build();

drb.addGlobalFooterVariable(totalAmount, DJCalculation.SUM, style);
drb.addGlobalFooterVariable(basicAmount, DJCalculation.SUM, style);
drb.addGlobalFooterVariable(cgstColumn, DJCalculation.SUM, style);
drb.addGlobalFooterVariable(sgstColumn, DJCalculation.SUM, style);

Also use style to resize fonts. 还可以使用样式来调整字体大小。

Style style = new StyleBuilder(false).setFont(new Font(18, Font.ARIAL_SMALL, true)).build();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM