我们能得到一个类似于.NET使用iReport的水晶报告的报告页面吗?我需要把报告放进框架里。
发布于 2010-03-16 12:30:29
假设您使用的是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);https://stackoverflow.com/questions/2452292
复制相似问题