How to change where fonts are located?

By: Diego Parrilla - dparrilla
How to change where fonts are located?
2003-03-17 06:13
Hi,

I have developed a Web-based reporting render engine with JasperReports, and I have found that the fonts and the graphics must be in the directory where my app-server was started.

I would like to know how to configure JasperReports to get these files from my 'favourite' directory. Here goes a bit of the code in the 'service' method of a servlet:

Map parameters = new HashMap();
if ((reportName!=null) && (reportName.equals(""))) {
parameters.put("ReportTitle",reportName);
}

parameters.put("BaseDir", reportDirectory + System.getProperty("file.separator"));

byte[] bytes;
try {
bytes =
JasperRunManager.runReportToPdf(
reportDirectory
+ System.getProperty("file.separator")
+ reportFile
+ ".jasper",
parameters,
new JRXmlDataSource(xmlDataSource));
} catch (JRException e) {
throw new ServletException(e);
} catch (CustomException e) {
throw new ServletException(e);
}

Anybody can help me? Thanks in advance
Diego




By: Teodor Danciu - teodord
RE: How to change where fonts are located?
2003-03-17 11:22

Hi,

The TTF files can be placed in the classpath.
This is how the samples work.

I hope this helps.
Teodor
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 17 years 1 month ago

0 Answers:

No answers yet
Feedback