From my JSP page:
Code: Select all
com.workpoint.client.ClientContext context = com.workpoint.client.ClientContext.createContext();
context.open(sDSN,sResourceID,sPassword);
String filename = ChartServlet.createJobStatusChart(context,"20040101","20040223",
session, new PrintWriter(out));
Code: Select all
public class ChartServlet extends HttpServlet {
public static String createJobStatusChart( ClientContext context,
String startDate,
String endDate,
HttpSession session,
PrintWriter pw) {
JFreeChart chart = JobStatusReport.getChart(context,startDate,endDate);
return createChartImage(session,pw,chart);
}
public static String createChartImage(HttpSession session,
PrintWriter pw,
JFreeChart chart){
String filename = "";
ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
try {
filename = ServletUtilities.saveChartAsPNG(chart, 500, 300, info, session);
// Write the image map to the PrintWriter
ChartUtilities.writeImageMap( pw, filename, info);
} catch (IOException e1) {
e1.printStackTrace();
}
pw.flush();
return filename;
}
}
Code: Select all
java.lang.NullPointerException
at org.jfree.chart.ChartUtilities.writeChartAsPNG(Unknown Source)
at org.jfree.chart.ChartUtilities.saveChartAsPNG(Unknown Source)
at org.jfree.chart.ChartUtilities.saveChartAsPNG(Unknown Source)
at org.jfree.chart.servlet.ServletUtilities.saveChartAsPNG(Unknown Source)
at com.workpoint.reports.charts.ChartServlet.createChartImage(ChartServlet.java:62)
at com.workpoint.reports.charts.ChartServlet.createJobStatusChart(ChartServlet.java:49)
Anyone have any ideas??