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
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
0 Answers:
No answers yet