Is a dataset referenceable to java code called by the report?

0

I am creating a report where there is a need to dynamically create an image based on the data in the report.  For example, my data set has x1,y1, w, h.  I have an image control which calls a my custom Java Class to dynamically draw rectangles based on this data.  So I need to know how to pass the data set into my Java Code or I need to know how get access to the data in the dataset from my class.  Please help.

 

import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import net.sf.jasperreports.engine.JRAbstractSvgRenderer;
import net.sf.jasperreports.engine.JRException;
 
public class CustomImageRenderer extends JRAbstractSvgRenderer
 {
    public void render ( Graphics2D g2d, Rectangle2D rect ) throws JRException
    {
        g2d.drawRect( 58, 250, 82, 5 ); // would like to source these points from the data set.
        g2d.drawRect( 58, 270, 82, 5 );
    }
    
aakhan999's picture
Joined: May 6 2013 - 9:07am
Last seen: 5 years 6 months ago

0 Answers:

No answers yet
Feedback
randomness