I am writing a java code that will generate excel .xlsx
file format. Using apache poi v5.0
and birt
engine runtime v4.3.0
. Looks like poi
doesn't have setBoldweight()
method. Is this version dependency error or how to I solve this. Is there any other alternative to solve this?. Please help.
If it is version dependency error. Which version of birt report is compatible with apache-poi 5
?.
It give me this error
ERROR org.eclipse.birt.report.engine.api.impl.ReportEngine:2374 - Error happened while running the report.
java.lang.NoSuchMethodError: org.apache.poi.ss.usermodel.Font.setBoldweight(S)V
at uk.co.spudsoft.birt.emitters.excel.FontManager.createFont(FontManager.java:165)
at uk.co.spudsoft.birt.emitters.excel.FontManager.getFont(FontManager.java:230)
at uk.co.spudsoft.birt.emitters.excel.StyleManager.createStyle(StyleManager.java:169)
at uk.co.spudsoft.birt.emitters.excel.StyleManager.getStyle(StyleManager.java:217)
....
This is my code
IRunAndRenderTask task=null;
birtEngine = MSBirtEngine.getBirtEngine(null);
task = birtEngine.createRunAndRenderTask(design);
ByteArrayOutputStream ous = null;
if("xlsx".equals(format)){
EXCELRenderOption options = new EXCELRenderOption();
options.setOutputFormat(format);
ous = new ByteArrayOutputStream();
options.setOutputStream(ous);
task.setRenderOption(options);
}
task.run();
...