Jump to content
JasperReports Library 7.0 is now available ×

Recommended Posts

By: All State Fastener IT group - asf_sourceforge

Images

2006-05-22 11:24

I've read a few posts on how to put images in reports, but I'm still confused. I'm a bit new to iReports, so I don't really know exactly what I'm doing.

 

I want an image in the header path, and the image is in the working directory of the report, but I don't know how to code the form to pull the image from the server.

 

What do I have to do to get the image to display?

 

Thanks!

 

 

 

 

By: GSantos - gureba

RE: Images

2006-05-22 13:32

You can create a parameter to receive de path and the name of the image, so you can use this parameter as the source of the image object.

 

Gustavo Santos

 

 

 

 

By: All State Fastener IT group - asf_sourceforge

RE: Images

2006-05-22 13:36

I understand how to create a new paramater, but I don't know what to put in the options.

 

 

 

 

By: Wal Millard - walmillard

RE: Images

2006-05-22 18:11

 

In the "Image Expression" of the image object simply put the $P{} like this:

 

$P{LogoPicture}

 

when you build in java, pass something like :

 

"c:\templates\Logos\Logo.gif"

 

where Logo.gif is the image you want to display.

 

Note you should get the File Separator from java for the operating system you are using to build this path.

 

to test in iReport set the parameters default value to this path...

 

"c:\templates\Logos\Logo.gif"

 

 

luck

WalMillard

 

 

 

 

By: All State Fastener IT group - asf_sourceforge

RE: Images

2006-05-23 05:22

Alright.

I've set my image paramter as $P{LOGO_PATH} and inside paramater's value is "T:\asf_small.jpg" but I still get 3 errors compiling.

######

Errors compiling .NotesReport.jasper!

it.businesslogic.ireport.ReportClassLoader@bfe13d net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Cannot cast from String to InputStream value = (java.io.InputStream)("T://asf_small.jpg"); <----------------------------------------> 2. Cannot cast from String to InputStream value = (java.io.InputStream)("T://asf_small.jpg"); <----------------------------------------> 3. Cannot cast from String to InputStream value = (java.io.InputStream)("T://asf_small.jpg"); <----------------------------------------> 3 errors at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193) at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:104) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:127) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:109) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:473) at java.lang.Thread.run(Unknown Source

#######

 

Is there something I'm doing wrong?

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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