背景说明:
本地打印成功打印报表后,用户可使用自己定义的监听类方法,实现想要的功能,比如记录打印日志。
自定义打印监听类需要实现润乾报表提供的com.raqsoft.report.ide.usermodel.ILocalPrintListener接口,请看如下示例:
◆ 代码示例
package localprint; //指定类路径
import org.json.JSONObject;
import com.raqsoft.report.ide.usermodel.ILocalPrintListener;
import com.scudata.common.Logger;
public class MyListener implements ILocalPrintListener {
//params: 从报表页面传过来的参数,包括request、session中保存的参数和传递给报表的参数
public void printed( JSONObject params ) throws Exception {
String name = params.getString( "reportName" );
Logger.info( "报表:" + name + " 已打印" );
}
}