简体   繁体   English

在Java中设置Jasper Report字体

[英]Set Font of Jasper Report in java

I want to set font for Jasper report in Java Code.Is it possible? 我想在Java代码中为Jasper报告设置字体,可以吗? If yes then please suggest answer. 如果是,请提出答案。

If you are using dynamic jasper then you can use : 如果您正在使用动态碧玉,则可以使用:

package

import ar.com.fdvs.dj.domain.constants.Font;
import ar.com.fdvs.dj.domain.Style;

and use those packages like :- 并使用以下软件包:

Font columnFont=new Font(10, "SansSerif", false);
Style stringColumnStyle=new Style("stringColumnStyle");
stringColumnStyle.setFont(columnFont);
stringColumnStyle.setBorder(Border.THIN);
stringColumnStyle.setHorizontalAlign(HorizontalAlign.LEFT);
stringColumnStyle.setVerticalAlign(VerticalAlign.MIDDLE);
stringColumnStyle.setBorderColor(Color.LIGHT_GRAY);

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

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