Jump to content
Changes to the Jaspersoft community edition download ×

jasperreports.properties in a web application


Recommended Posts

By: frblusso - frblusso

jasperreports.properties in a web application

2006-04-04 07:46

Hi

 

i'am trying to generate a pdf report using the ReportsFonts.jrxml example in a web application (websphere).

If I put the external ttf fonts COMIC.TTF, COMICBD.TTF in the classpath (directly under the /javasource directory) the report is ok, but i 'd like to put the ttf fonts in another directory . I think I can do it by using a configuration file jasperreports.properties to set the key net.sf.jasperreports.export.pdf.fontdir.jasper

but i don't know how and when to read this file in the web application.

 

thancks for any help!

 

 

 

 

 

By: frblusso - frblusso

RE: jasperreports.properties in a web application

2006-04-07 00:03

As i have no answer to my question, i complete it . In the directory demo/samples/fonts in jasper1.2.0, the file jasperreports.properties exists but i don't see where it is used.

thancks for your help

 

 

 

 

 

 

 

 

By: Lucian Chirita - lucianc

RE: jasperreports.properties in a web applica

2006-04-07 07:31

Hi

 

jasperreports.properties is automatically read by JR if found on the classpath (you can change the config file name with -Dnet.sf.jasperreports.properties).

 

Therefore, you only need to put the file on your web application's classpath (e.g. under WEB-INF/classes).

 

HTH,

Lucian

 

 

 

 

By: frblusso - frblusso

RE: jasperreports.properties in a web application

2006-04-10 02:30

Thancks for your help, but i have still a problem.

the jasper.properties file is read but this error message appears [Erreur de servlet]-[../../../fonts/COMICBD.TTF not found as file or resource.]: ExceptionConverter:

this is what there is in the jasper.properties:

net.sf.jasperreports.export.pdf.font.Comic=../../../fonts/COMIC.TTF

net.sf.jasperreports.export.pdf.font.ComicBd=../../../fonts/COMICBD.TTF

# Also font directories can be specified.

#net.sf.jasperreports.export.pdf.fontdir.jasper=../../../fonts

 

I have tries with this file version too :

net.sf.jasperreports.export.pdf.font.Comic=COMIC.TTF

net.sf.jasperreports.export.pdf.font.ComicBd=COMICBD.TTF

net.sf.jasperreports.export.pdf.fontdir.jasper=../../../fonts

but there is the same error message'Erreur de servlet]-[COMICBD.TTF not found as file or resource.]'

the jasper.properties is under /WebContent/WEB-INF/classes directory and the fonts files are under /WebContent/fonts directory

I have the feeling that the property net.sf.jasperreports.export.pdf.fontdir.jasper is not read

 

 

 

 

 

 

 

 

By: Lucian Chirita - lucianc

RE: jasperreports.properties in a web applica

2006-04-10 07:23

Note that the paths you use for the font files should be relative to the JVM's working directory (and not relative to jasperreports.properties). You should consult then your web container's documentation and correct the paths. This should take care about iText complaining that it's not able to locate the files.

 

Also note that if you define a font directory, you don't need to individually specify fonts in that directory, all the font files from the directory would be registered with iText and you'd be able to use them in your report by their names.

 

HTH,

Lucian

 

 

 

 

By: frblusso - frblusso

RE: jasperreports.properties in a web applica

2006-04-14 04:53

Sorry but i do not succeed to find the correct path to put in the fontdir.jasper property. Even if i put an absolute path in that property it does not work.

when you say to put an path relative to the jvm's directory, what does it mean? a colleague says it corresponds to the java home directory ?

thanks for your help!

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...