Home
Analytics
Text font is applied when report is generated with eclipse but not with the report engine
frenchGuy
Hi,<br />
<br />
I'm trying to generate a report with the BIRT report engine deployed on a Linux server but the font (Arial or dejavu SANS) applied on the rptdesign are not exported in my PDF report.<br />
But when I export the report in Eclipse it works (I work on Windows XP)<br />
<br />
I've developped a custom generator and the generation code is the following :<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
IReportEngine engine = null;
engine = Engine.getInstance().getEngine();
IReportRunnable design = null;
try {
design = engine.openReportDesign(file);
} catch (EngineException e) {
Logger.exception(e);
return false;
}
IRunAndRenderTask runtask = engine.createRunAndRenderTask(design);
Map reportParams = ReportExecutor.evaluateParameterValues(engine, design, databaseParams);
runtask.setParameterValues(reportParams);
if (!runtask.validateParameters()) {
Logger.writeLog("Error : Cannot validate parameters");
return (false);
}
List<RenderOption> renderOptions = ReportFormat.getRenderOptions(task, archiveFolder);
for (Integer i = 0; i < renderOptions.size(); i++) {
try {
runtask.setRenderOption(renderOptions.get(i));
runtask.run();
} catch (EngineException e) {
Logger.exception(e);
return (false);
}
runtask.close();
</pre>
<br />
Could you help me with this?<br />
<br />
Do you also have any advise, when you look at the code, to improve the generation of the reports?<br />
<br />
Thanks!
Find more posts tagged with
Comments
mwilliams
Hi Mat,
Is the PDF output the only output that is not showing the font as you expect it to be? Are you sure the font is available on your linux box?
frenchGuy
Hi Michael,
I also tried to export the report in DOC, I have the same problem.
I installed the package dejavu-lgc-fonts on my CentOS, restarted my report Engine and nothing changed.
mwilliams
Where did you install the font?
Try putting your font in the following Linux directory:
/usr/share/fonts/truetype
or
/usr/share/fonts/default/TrueType
You can also specify your own font search path by setting the environment variable BIRT_FONT_PATH.
frenchGuy
dejavu-lgc-fonts was not the right package. I downloaded the ttf files from dejavu-fonts.org and copied it in /usr/share/fonts/default/TrueType and it works now.
Thanks for your help!
mwilliams
As always, glad to help!