Jump to content
We've recently updated our Privacy Statement, available here ×

How to change where fonts are located?


Recommended Posts

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

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...