try
{
Main.frame.showProgress("Imprimiendo...");
Main.frame.table.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
Model stikers = new Model("Stikers");
stikers.delete("");
String[] columns = {"numero","lista_id"};
String[] values = new String[2];
values[1] = ""+listId;
for (int i = desde; i < desde + cantidad; i++){
values[0] = ""+i;
stikers.insert( columns, values);
}
Map<String, Object> params = new HashMap<String, Object>();
params.put("code_title", title);
JasperReport report = JasperCompileManager.compileReport(Config.getValue("app.reportTemplatePath"));
Debug.log("Compiling report...");
JasperPrint print = JasperFillManager.fillReport(report, params, DB.getInstance().getConn());
Debug.log("Filling report...");
//JasperViewer.viewReport(print, false);
DocumentViewer documentViewer = DocumentViewer.show(print);
Debug.log("Show report...");
if(documentViewer.isPrintExecuted()){
printed = true;
Main.lista.update("ultimoStiker="+ (desde + cantidad -1), "id="+listId);
Model strip = new Model("strip");
String[] columns1 = {"inicio","cantidad","lista_id"};
String[] valuesList = {""+desde, ""+cantidad,""+listId};
strip.insert(columns1, valuesList);
}else{
Main.showMsg("No se imprimió el listado");
}
Main.frame.filtrar(Calendar.getInstance());