oi gente!!
to usando o birt pra faze o layout do relatorio, e o engine do birt pra roda o relatorio via web…
peguei um exemplo pra acompanha…
mas qdo tento rodar, tenho o erro:
e minha classe:
//imports
public class TesteBIRT {
public static void main (String[] args) throws EngineException, IOException {
// Cria o engine (para simplificar, usamos path fixo do ERE)
EngineConfig config = new EngineConfig();
config.setEngineHome("/home/eric/Programas/birt-runtime-2_1_0/ReportEngine");
ReportEngine engine = new ReportEngine(config);
// Carrega o arquivo de design
IReportRunnable design = engine.openReportDesign("carros3.rptdesign");
// Cria tarefa de renderiza��o, configurada para para HTML
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
HTMLRenderContext renderCtx = new HTMLRenderContext();
renderCtx.setImageDirectory("image");
HashMap ctxMap = new HashMap();
ctxMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderCtx);
task.setAppContext(ctxMap);
HTMLRenderOption options = new HTMLRenderOption();
// Gera a sa�da num arquivo tempor�rio
File output = new File(System.getProperty("java.io.tmpdir"), "birt.html");
options.setOutputFileName(output.getAbsolutePath());
options.setOutputFormat("html");
task.setRenderOption(options);
task.run();
engine.destroy();
// Cria um componente Swing para exibir o HTML
JEditorPane htmlPane = new JEditorPane("file:///" + output.getAbsolutePath());
htmlPane.setEditable(false);
JFrame frame = new JFrame();
frame.add(htmlPane);
frame.setBounds(0, 0, 640, 480);
frame.setVisible(true);
// Exibe o consumo de mem�ria do heap
System.gc();
Runtime rt = Runtime.getRuntime();
System.out.println(rt.totalMemory() - rt.freeMemory());
}
}
obs: antes q pensem q o meu arquivo carros3.rtpdesign naum exista (tbm pensei q fosse isso), ele estah lah sim, ctz. hehehe
se alguem tiver alguma ideia do q possa ser…
hehehe
desde jah agradeço.