18 package org.turro.financials.menu;
21 import java.io.IOException;
22 import java.util.Date;
23 import java.util.logging.Level;
24 import java.util.logging.Logger;
25 import javax.activation.MimetypesFileTypeMap;
26 import jxl.read.biff.BiffException;
27 import jxl.write.WriteException;
28 import org.turro.command.Command;
29 import org.turro.command.Context;
30 import org.turro.elephant.context.ElephantContext;
31 import org.turro.financials.entity.RegisterView;
32 import org.turro.financials.model.register.ViewWrapper;
33 import org.turro.financials.sheets.ReportSheet;
34 import org.turro.financials.view.ViewListbox;
35 import org.turro.i18n.I_;
36 import org.turro.zkoss.dialog.InputDialog;
37 import org.turro.zkoss.dialog.InputField;
38 import org.zkoss.zk.ui.Page;
39 import org.zkoss.zul.Filedownload;
56 page,
I_.
get(
"Report sheets"),
60 public Object execute(Context context) {
65 if(fields.length > 0) {
67 if(
"Date".equals(f.getLabel())) {
69 }
else if(
"Sheet".equals(f.getLabel())) {
70 file = (File) f.getValue();
71 }
else if(
"View".equals(f.getLabel())) {
78 Filedownload.save(rs.
getExcel(),
new MimetypesFileTypeMap().getContentType(file.getName()), file.getName());
79 }
catch (IOException | BiffException | WriteException ex) {
static String getRealPath(String path)
static String logMsg(String msg)
static RegisterView getFormalView()
static String get(String msg)