您的位置:首页 > 编程语言 > ASP

swing程序中如何响应JasperViewer关闭事件?

2010-07-06 11:18 330 查看
http://ajava.org/hot/print/16569.html

http://www.techienuggets.com/Comments?tx=25302

625472008-02-18 14:44:11.0Can you try
JasperViewer jrviewer = new JasperViewer(jasperPrint, false);
instead of
JasperViewer jrviewer = new JasperViewer(jasperPrint);
and see if it works?
http://jasperreports.sourceforge.net/api/net/sf/jasperreports/view/JasperViewer.html#JasperViewer(net.sf.jasperreports.engine.JasperPrint,%20boolean)
regards,
karthik

Jacques Nogueira dos Santos wrote:
>
>
>
> Hello, I´m having a problem with jrviewer.
>
> I have a form that let´s the user inform the values for the report. On
> the action of the button has the following code:
>
>
>
> .
>
> .
>
> .
>
> JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,
> map,con);
>
> JasperViewer jrviewer = new JasperViewer(jasperPrint);
>
> jrviewer.setDefaultCloseOperation( DISPOSE_ON_CLOSE );
>
> jrviewer.setVisible(true);
>
>
>
>
>
> When I click on 'X' of the jrviewer, it´s close all the project. So I
> used the DEBUG and on Local Variables/ jrviewer, the isExitClose has
> value TRUE.
>
>
>
>
>
> What´s happening? What must I do so as to solve this problem? I want
> the jrviwer just dispose on close, and the first Form continue
> visible, not closing all the project.
>
>
>
>
>
> Thanks.
>
971182008-05-11 23:13:14.0You should call JasperViewer instance with following code.
JasperViewer jasperViewer = new JasperViewer(jasperPrint, false);

Because:
============================================
public JasperViewer(JasperPrint jasperPrint){
this(jasperPrint, true);
}

public JasperViewer(JasperPrint jasperPrint, boolean isExitOnClose){
this(jasperPrint, isExitOnClose, null);
}
============================================

JasperViewer(JasperPrint jasperPrint) constructor calls JasperViewer with exit on close.

1847802008-11-24 20:45:36.0Thankyou so much karthik,
I saw your codes its working so fine and fulfilled my requirement.

regards,
Rohit.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: