JAVA报告工具iReport

我们可以使用iReport获得类似.Net的Crystal报告的报告页面吗? 那就是我需要在框架内获取报告。 请帮帮我。

假设您使用的是Swing,下面是一个如何操作的示例。

编辑:

尝试获取JasperViewer容器并将其添加到主JFrame或JPanel。

有点黑客工作,但它应该做的伎俩。

JasperDesign jd = JRXMLoader.load("FilePath"); JasperReport jr = JasperCompileManager.compileReport(jd); JasperPrint jp = JasperFillManager.fillReport((jr),null,con); // Create an instance of the JasperViewer instead of using the static call JasperViewer viewer=new JasperViewer(jp,false); // Get the viewers container and add that to the main frame or panel Container container = viewer.getContentPane(); myMainJFrame.add(container);