Java 如何在eclipsercp中集成JRViewer
我有一个RCP应用程序,它一直运行良好…直到现在 我必须升级一些读写xlsm和xlsx文件的模块,所以我升级了poi 但是它破坏了我的JasperReport报告,版本非常旧,2.0.3,所以我也尝试升级到6.1.0,其中包含我需要的poi版本 但是我不能让它在viewpart中工作 这就是jasperreports2.0.3现在的样子 “导出/另存为”按钮不工作,出现以下错误:Java 如何在eclipsercp中集成JRViewer,java,jasper-reports,eclipse-rcp,Java,Jasper Reports,Eclipse Rcp,我有一个RCP应用程序,它一直运行良好…直到现在 我必须升级一些读写xlsm和xlsx文件的模块,所以我升级了poi 但是它破坏了我的JasperReport报告,版本非常旧,2.0.3,所以我也尝试升级到6.1.0,其中包含我需要的poi版本 但是我不能让它在viewpart中工作 这就是jasperreports2.0.3现在的样子 “导出/另存为”按钮不工作,出现以下错误: net.sf.jasperreports.engine.JRPrintHyperlink.getHyperlink
net.sf.jasperreports.engine.JRPrintHyperlink.getHyperlinkType()
谷歌和我得到了升级和使用JRViewer的提示
我试着回答这个问题:但我没有成功
有人能给我一些线索吗?我知道了。。。
已修改CreatePartControl
public void createPartControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FillLayout(SWT.HORIZONTAL));
//viewerComposite = new ViewerComposite(container,SWT.BORDER);
//viewerComposite.setLayoutData(new GridData(GridData.FILL,GridData.FILL,true,true));
//desde aca
//add the SWT_AWT compposite for SWING contents of GUI
final Composite swtAwtComposite = new Composite(container, SWT.EMBEDDED);
swtAwtComposite.setBounds(10, 0, 767, 600);
Frame frame = SWT_AWT.new_Frame(swtAwtComposite);
Panel panel = new Panel();
frame.add(panel);
panel.setLayout(new BorderLayout(0, 0));
JRootPane rootPane = new JRootPane();
rootPane.setSize(767, 600);
panel.add(rootPane);
//Define a container yourself
c = rootPane.getContentPane();
super.setPartName("Reportes");
}
我从另一个视图传递JasperPrint对象,所以我创建了一个void方法
public void setJasperPrint(JasperPrint jrPrint){
this.jrPrint = jrPrint;
//
jasperviewer = new JRViewer(jrPrint);
//Add the JRViewer object onto the container to render in GUI
c.add(jasperviewer);
}
工作起来很有魅力
新面貌!
但它是有效的
致以最诚挚的问候您应该发布代码以重现问题和跟踪