How to use Image as parameter?

By: James Lin - inchlin How to use Image as parameter? 2003-05-07 23:26 I try to use image in my report The image has one "expression" field What should I put on this field? Suppose the parameter call "DoctorName" and the datatype is inputstream Then I should set my image datatype to "inputstream"? Thanks for any help! By: Teodor Danciu - teodord RE: How to use Image as parameter? 2003-05-11 04:44 Hi, I'm not sure where your image comes from. If it comes from a report parameter, you should know that you can pass anything as parameters. And you could even pass a java.awt.Image object from the parent application to the report. Or you could pass the file name as a parameter, if the image is loaded from a file. This can be seen in the "jasper" sample, where the image in the summary section is passed as a java.awt.Image parameter. But if the image comes from a data source field, then we have a different story. It depends on whether you are getting the data from a database through an SQL query or if you are supplying an in-memory JRDataSource instance. If the image comes from a database, then I think you should indeed declare the image corresponding report field as a and use it directly in the <imageExpression>. But if you use a custom made JRDataSource, you have the freedom to pass the image in whatever form your might want to: filename, Image object, URL, etc. I hope this helps. Teodor
2006 IR Open Discussion's picture
Joined: Aug 10 2006 - 3:29am
Last seen: 8 years 2 months ago


No answers yet