BIRT 차트 보고서를 jsp..if로로드 할 때 문제가 발생했습니다. 내 보고서에 테이블을 사용하면 멋지게 표시되지만 차트로 변경하면 내 jsp에서 빈 페이지가 표시됩니다 .. 어떻게이 문제를 해결할 수 있습니까 ??JSP 내부에 BIRT 차트를로드 할 수 없습니다
여기 내 HTML 렌더링입니다.
public Resolution htmlReport() throws EngineException, SemanticException {
ByteArrayOutputStream reportOutput = new ByteArrayOutputStream();
String path = getCompassContext().getServletContext().getRealPath(
"/report");
// @TODO
String user = getCompassContext().getUser().getUsername();
birtReport.setUser(user);
birtReport.setBirtEngine(getCompassContext().getBirtEngine());
path = CompassConfig.getBirtReport(); //+ "/login_time.rptdesign";
birtReport.setReportDesignPath(path);
birtReport.setReportDesignName("/test.rptdesign");
/**
* Generates the html report.
*
* @return forward to the jsp page
* @throws EngineException when opening report design or reunning the report
* @throws SemanticException when changing properties of DesignElementHandle
*/
// set output options
IHTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat(IHTMLRenderOption.OUTPUT_FORMAT_HTML);
options.setOutputStream(reportOutput);
options.setEmbeddable(false);
// options.setBaseImageURL(context.getRequest().getContextPath() + "/images");
//options.setImageDirectory(context.getServletContext().getRealPath("/images"));
options.setImageHandler(new HTMLServerImageHandler());
options.setMasterPageContent(true);
birtReport.generateReport(options);
return new StreamingResolution("text/html", new ByteArrayInputStream(reportOutput.toByteArray()));
}
여기 내 BIRT 엔진
public void generateReport(IRenderOption options) throws EngineException,
SemanticException {
generateParamaters();
// get the engine
IReportEngine birtReportEngine = birtEngine;
// open the report design
String path = reportDesignPath + "/" + reportDesignName;
IReportRunnable design = birtReportEngine.openReportDesign(path);
// create task to run and render report
IRunAndRenderTask task = birtReportEngine
.createRunAndRenderTask(design);
Map<String, Object> appContext = task.getAppContext();
Connection con = DataSourceUtils.getConnection();
appContext.put("OdaJDBCDriverPassInConnection", con);
HashMap<String, String[]> multiValParam = getMultiValParam();
if(multiValParam != null && multiValParam.size() > 0) {
Set<String> key = multiValParam.keySet();
Iterator<String> ite = key.iterator();
while(ite.hasNext()) {
String paramName = (String) ite.next();
String[] paramValues = multiValParam.get(paramName);
task.setParameterValue(paramName, paramValues);
}
}
task.setParameterValues(getParameter());
task.setRenderOption(options);
task.setAppContext(appContext);
// run report
task.run();
task.close();
}
정말 도움이 필요
입니다 !!!!