multitenant
František Přibyl 11 years ago
commit 4451850603

@ -61,6 +61,7 @@ public class Constants {
public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava"; public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava";
public final static ReportMapping REPORTS[] = { public final static ReportMapping REPORTS[] = {
new ReportMapping(MOD_ADDRESSBOOK, new Report("Pokusná sestava", "report")) new ReportMapping(MOD_ADDRESSBOOK, new Report("Adresní karty", "address")),
new ReportMapping(MOD_ADDRESSBOOK, new Report("Adresna", "address", false, true))
}; };
} }

@ -28,7 +28,7 @@ public class StringUtils {
} }
public static String localize(String key) { public static String localize(String key) {
return Labels.getLabel(key); return Labels.getLabel(key) == null ? key : Labels.getLabel(key);
} }
private static String getLocalized(String str) { private static String getLocalized(String str) {

@ -1,5 +1,7 @@
package info.bukova.isspst.reporting; package info.bukova.isspst.reporting;
import info.bukova.isspst.StringUtils;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -49,13 +51,11 @@ public class DynamicGenerator implements Generator {
Class<?> clazz = colClass(col); Class<?> clazz = colClass(col);
if (clazz != null) { if (clazz != null) {
try { try {
rb.addColumn(col, col, clazz, 30, false); rb.addColumn(StringUtils.localize(col), col, clazz, 30, false);
} catch (ColumnBuilderException e) { } catch (ColumnBuilderException e) {
// TODO Auto-generated catch block throw new ReportException(e);
e.printStackTrace();
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
// TODO Auto-generated catch block throw new ReportException(e);
e.printStackTrace();
} }
} }
} }
@ -70,11 +70,8 @@ public class DynamicGenerator implements Generator {
JasperReport report = DynamicJasperHelper.generateJasperReport(dr, new ClassicLayoutManager(), definition.getParams()); JasperReport report = DynamicJasperHelper.generateJasperReport(dr, new ClassicLayoutManager(), definition.getParams());
return JasperRunManager.runReportToPdf(report, definition.getParams(), ds); return JasperRunManager.runReportToPdf(report, definition.getParams(), ds);
} catch (JRException e) { } catch (JRException e) {
// TODO Auto-generated catch block throw new ReportException(e);
e.printStackTrace();
} }
return null;
} }
private Class<?> colClass(String col) { private Class<?> colClass(String col) {

@ -1,11 +1,20 @@
package info.bukova.isspst.reporting; package info.bukova.isspst.reporting;
import javax.servlet.ServletContext;
import org.springframework.beans.factory.annotation.Autowired;
public class GeneratorFactory { public class GeneratorFactory {
@Autowired
private ServletContext context;
public Generator createGenerator(ReportDefinition definition) { public Generator createGenerator(ReportDefinition definition) {
switch (definition.getReport().getType()) { switch (definition.getReport().getType()) {
case DYNAMIC: case DYNAMIC:
return new DynamicGenerator(definition); return new DynamicGenerator(definition);
case DEFINED:
return new PredefinedGenerator(definition, context);
default: default:
return null; return null;

@ -0,0 +1,44 @@
package info.bukova.isspst.reporting;
import java.io.File;
import javax.servlet.ServletContext;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.JasperRunManager;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.engine.util.JRProperties;
@SuppressWarnings("deprecation")
public class PredefinedGenerator implements Generator {
private ReportDefinition definition;
private ServletContext ctx;
public PredefinedGenerator(ReportDefinition definition, ServletContext ctx) {
this.definition = definition;
this.ctx = ctx;
}
@Override
public byte[] generate() {
byte[] bytes = null;
try {
JasperReport report = (JasperReport) JRLoader.loadObject(getReportFile());
JRProperties.setProperty("net.sf.jasperreports.default.pdf.encoding", "Cp1250");
bytes = JasperRunManager.runReportToPdf(report, definition.getParams(), new JRBeanCollectionDataSource(definition.getDataSet()));;
} catch (JRException e) {
throw new ReportException(e);
}
return bytes;
}
protected File getReportFile() {
return new File(ctx.getRealPath("WEB-INF/reports") + "/" + definition.getReport().getJasperFile() + ".jasper");
}
}

@ -6,17 +6,46 @@ public class Report {
private ReportType type; private ReportType type;
private String name; private String name;
private String jasperFile; private String jasperFile;
private boolean hasSettings;
private boolean singleRecord;
public Report() { public Report() {
hasSettings = false;
singleRecord = false;
} }
/**
* @param name
* @param jasperFile
*/
public Report(String name, String jasperFile) { public Report(String name, String jasperFile) {
this();
this.type = ReportType.DEFINED; this.type = ReportType.DEFINED;
this.name = name; this.name = name;
this.jasperFile = jasperFile; this.jasperFile = jasperFile;
} }
/**
* @param name
* @param jasperFile
* @param hasSettings
*/
public Report(String name, String jasperFile, boolean hasSettings) {
this(name, jasperFile);
this.hasSettings = hasSettings;
}
/**
* @param name
* @param jasperFile
* @param hasSettings
* @param singleRecord
*/
public Report(String name, String jasperFile, boolean hasSettings, boolean singleRecord) {
this(name, jasperFile, hasSettings);
this.singleRecord = singleRecord;
}
public ReportType getType() { public ReportType getType() {
return type; return type;
} }
@ -41,4 +70,20 @@ public class Report {
this.jasperFile = jasperFile; this.jasperFile = jasperFile;
} }
public boolean isHasSettings() {
return hasSettings;
}
public void setHasSettings(boolean hasSettings) {
this.hasSettings = hasSettings;
}
public boolean isSingleRecord() {
return singleRecord;
}
public void setSingleRecord(boolean singleRecord) {
this.singleRecord = singleRecord;
}
} }

@ -1,6 +1,7 @@
package info.bukova.isspst.reporting; package info.bukova.isspst.reporting;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -16,38 +17,46 @@ public class ReportController {
private ReportDefinition reportDefinition; private ReportDefinition reportDefinition;
@Autowired @Autowired
private GeneratorFactory factory; private GeneratorFactory factory;
private static final String ERROR_MESSAGE = "<html><body><b>Generator returned no data!</b><br/>%s</body></html>";
private void writeError(OutputStream stream, Throwable e) {
writeError(stream, e.toString());
}
private void writeError(OutputStream stream, String message) {
String err = String.format(ERROR_MESSAGE, message);
try {
stream.write(err.getBytes(), 0, err.getBytes().length);
} catch (IOException e1) {
e1.printStackTrace();
}
}
@RequestMapping("report.pdf") @RequestMapping("report.pdf")
public void pdfReport(HttpServletResponse response) { public void pdfReport(HttpServletResponse response) {
Generator gen = factory.createGenerator(reportDefinition); final String contentType = "application/pdf";
byte[] data = gen.generate();
String contentType = "application/pdf";
ServletOutputStream os = null; ServletOutputStream os = null;
try { try {
os = response.getOutputStream(); os = response.getOutputStream();
} catch (IOException e1) {
e1.printStackTrace();
return;
}
// if (reportDefinition.getReport() == null || reportDefinition.getDataSet() == null) { if (reportDefinition.getReport() == null || reportDefinition.getDataSet() == null) {
// writeError(os, "Definition is null"); throw new ReportException("Definition is null");
// return; }
// }
response.setContentType(contentType); Generator gen = factory.createGenerator(reportDefinition);
response.setContentLength(data.length); byte[] data = gen.generate();
response.setContentType(contentType);
response.setContentLength(data.length);
try {
os.write(data, 0, data.length); os.write(data, 0, data.length);
os.flush(); os.flush();
os.close(); os.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
// } catch (ReportException e) { } catch (ReportException e) {
// writeError(os, e); writeError(os, e);
} finally { } finally {
if (os != null) { if (os != null) {
try { try {

@ -0,0 +1,20 @@
package info.bukova.isspst.reporting;
import info.bukova.isspst.services.IsspstException;
public class ReportException extends IsspstException {
/**
*
*/
private static final long serialVersionUID = 1L;
public ReportException(Throwable cause) {
super("Reporting exception: ", cause);
}
public ReportException(String message) {
super(message);
}
}

@ -4,7 +4,7 @@ public class IsspstException extends RuntimeException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final static String MSG = "RsFaktura Exception. "; private final static String MSG = "IS Exception. ";
public IsspstException() { public IsspstException() {
super(MSG); super(MSG);

@ -301,7 +301,8 @@ public class ListViewModel<T extends DataModel> {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("reports", service.getReports()); params.put("reports", service.getReports());
params.put("data", dataList); params.put("data", dataList);
Window win = (Window) Executions.createComponents("/app/reportDialog.zul", null, params); params.put("singleObject", dataBean);
Window win = (Window) Executions.createComponents("/app/reporting/reportDialog.zul", null, params);
win.doModal(); win.doModal();
} }

@ -0,0 +1,21 @@
package info.bukova.isspst.ui;
import info.bukova.isspst.StringUtils;
import org.zkoss.bind.BindContext;
import org.zkoss.bind.Converter;
import org.zkoss.zk.ui.Component;
public class LocaleConverter implements Converter<String, String, Component> {
@Override
public String coerceToBean(String str, Component component, BindContext ctx) {
return str;
}
@Override
public String coerceToUi(String str, Component component, BindContext ctx) {
return StringUtils.localize(str);
}
}

@ -0,0 +1,67 @@
package info.bukova.isspst.ui.reporting;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.util.ArrayList;
import java.util.List;
import info.bukova.isspst.reporting.Report;
import info.bukova.isspst.reporting.ReportDefinition;
import info.bukova.isspst.reporting.ReportType;
import info.bukova.isspst.ui.ListChecks;
import info.bukova.isspst.ui.LocaleConverter;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ColSelectVM {
@WireVariable
private ReportDefinition reportDefinition;
private LocaleConverter locConverter;
@Init
public void init() {
locConverter = new LocaleConverter();
}
public ListChecks<String> getColumns() {
Report selected = reportDefinition.getReport();
List<Object> data = reportDefinition.getDataSet();
if (selected == null || selected.getType() != ReportType.DYNAMIC) {
return null;
}
if (data == null || data.size() == 0) {
return null;
}
BeanInfo beanInfo;
try {
beanInfo = Introspector.getBeanInfo(data.get(0).getClass());
} catch (IntrospectionException e) {
return null;
}
PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
List<String> properties = new ArrayList<String>();
for (PropertyDescriptor pd : pds) {
if (!(pd.getName().equals("password") || pd.getName().equals("class") || pd.getName().equals("id") || pd.getName().equals("valid"))) {
properties.add(pd.getName());
}
}
ListChecks<String> columns = new ListChecks<String>(reportDefinition.getFieldsToPrint(), properties);
return columns;
}
public LocaleConverter getLocConverter() {
return locConverter;
}
public ReportDefinition getReportDefinition() {
return reportDefinition;
}
}

@ -1,16 +1,11 @@
package info.bukova.isspst.ui; package info.bukova.isspst.ui.reporting;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.util.ArrayList;
import java.util.List;
import info.bukova.isspst.reporting.Report; import info.bukova.isspst.reporting.Report;
import info.bukova.isspst.reporting.ReportDefinition; import info.bukova.isspst.reporting.ReportDefinition;
import info.bukova.isspst.reporting.ReportType; import info.bukova.isspst.reporting.ReportType;
import java.util.List;
import org.zkoss.bind.annotation.BindingParam; import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.ExecutionArgParam; import org.zkoss.bind.annotation.ExecutionArgParam;
@ -24,19 +19,23 @@ public class ReportDialogVM {
private List<Report> reports; private List<Report> reports;
private Report selected; private Report selected;
private List<Object> data;
@WireVariable @WireVariable
private ReportDefinition reportDefinition; private ReportDefinition reportDefinition;
private List<Object> dataList;
private Object singleObject;
@Init @Init
public void init(@ExecutionArgParam("reports") List<Report> reports, public void init(@ExecutionArgParam("reports") List<Report> reports,
@ExecutionArgParam("data") List<Object> data) { @ExecutionArgParam("data") List<Object> data,
@ExecutionArgParam("singleObject") Object singleObject) {
this.reports = reports; this.reports = reports;
this.data = data;
if (data != null && data.size() > 0 && data.get(0).getClass() != reportDefinition.gatDataClass()) { if (data != null && data.size() > 0 && data.get(0).getClass() != reportDefinition.gatDataClass()) {
reportDefinition.clear(); reportDefinition.clear();
} }
dataList = data;
this.singleObject = singleObject;
} }
public List<Report> getReports() { public List<Report> getReports() {
@ -47,50 +46,47 @@ public class ReportDialogVM {
return reportDefinition; return reportDefinition;
} }
public ListChecks<String> getColumns() {
if (selected == null || selected.getType() != ReportType.DYNAMIC) {
return null;
}
if (data == null || data.size() == 0) {
return null;
}
BeanInfo beanInfo;
try {
beanInfo = Introspector.getBeanInfo(data.get(0).getClass());
} catch (IntrospectionException e) {
return null;
}
PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
List<String> properties = new ArrayList<String>();
for (PropertyDescriptor pd : pds) {
properties.add(pd.getName());
}
ListChecks<String> columns = new ListChecks<String>(reportDefinition.getFieldsToPrint(), properties);
return columns;
}
public Report getSelected() { public Report getSelected() {
return selected; return selected;
} }
@NotifyChange("columns") @NotifyChange({"optionsForm", "selected"})
public void setSelected(Report selected) { public void setSelected(Report selected) {
this.selected = selected; this.selected = selected;
reportDefinition.setReport(selected);
if (selected.isSingleRecord()) {
reportDefinition.setSingleObject(singleObject);
} else {
reportDefinition.setDataSet(dataList);
}
} }
@Command @Command
public void print(@BindingParam("window") Window window) { public void print(@BindingParam("window") Window window) {
reportDefinition.setDataSet(data);
reportDefinition.setReport(selected);
if (window != null) { if (window != null) {
window.detach(); window.detach();
} }
Window reportWin = (Window) Executions.createComponents("/app/report.zul", null, null); Window reportWin = (Window) Executions.createComponents("/app/reporting/report.zul", null, null);
reportWin.doModal(); reportWin.doModal();
} }
public String getOptionsForm() {
if (selected != null && selected.getType() == ReportType.DYNAMIC) {
return "/app/reporting/colSelect.zul";
} else if (selected != null && selected.isHasSettings()) {
return "/app/reporting/" + selected.getJasperFile() + ".zul";
} else {
return "/app/reporting/noOptions.zul";
}
}
public Object getSingleObject() {
return singleObject;
}
public void setReportDefinition(ReportDefinition reportDefinition) {
this.reportDefinition = reportDefinition;
}
} }

@ -1,4 +1,4 @@
package info.bukova.isspst.ui; package info.bukova.isspst.ui.reporting;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;

@ -0,0 +1,38 @@
#Obecné
created=Vytvořeno
ownedBy=Vytvořil
modified=Změněno
modifiedBy=Změnil
#Adresa
city=Město
company=Firma
contactName=Kontaktní osoba
department=Oddělení
description=Poznámka
dic=DIČ
email=E-mail
houseNumber=Číslo domu
ic=
phone=Telefon
state=Stát
street=Ulice
web=Webová adresa
zipCode=PSČ
#Budova
code=Kód
name=Název
#Uživatel
accountNonExpired=Platný
accountNonLocked=Odemknutý
authorities=Role
credentialsNonExpired=Heslo je platné
enabled=Povolený
firstName=Jméno
fullName=Plné jméno
lastName=Příjmení
notify=Posílat oznámení
personalNumber=Osobní číslo
username=Uživatelské jméno

@ -86,6 +86,8 @@ ReportSend=Odeslat
ReportPrint=Tisk ReportPrint=Tisk
ReportReports=Sestavy ReportReports=Sestavy
ReportTitle=Nadpis sestavy: ReportTitle=Nadpis sestavy:
ReportOptions=Volby sestavy
ReportNoOptions=Žádná nestavení
Error=Chyba Error=Chyba
ErrorRights=K vykobání této operace nemáte dostatečná oprávnění ErrorRights=K vykobání této operace nemáte dostatečná oprávnění

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="address" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="2cacf86c-b3c7-40ea-97b1-bdf63b3abc19">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<field name="company" class="java.lang.String"/>
<field name="city" class="java.lang.String"/>
<field name="street" class="java.lang.String"/>
<field name="houseNumber" class="java.lang.String"/>
<field name="ic" class="java.lang.Long"/>
<field name="zipCode" class="java.lang.String"/>
<field name="dic" class="java.lang.String"/>
<field name="web" class="java.lang.String"/>
<field name="email" class="java.lang.String"/>
<field name="contactName" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="18" splitType="Stretch"/>
</title>
<pageHeader>
<band height="28" splitType="Stretch">
<staticText>
<reportElement uuid="f87bcea0-ca1b-494e-af40-25b7ecc257e3" x="247" y="0" width="113" height="26"/>
<textElement>
<font size="18" isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[Adresy]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="16" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="163" splitType="Stretch">
<line>
<reportElement uuid="878c0f64-8c89-4965-8f92-1fe06a5c568e" x="0" y="161" width="555" height="1"/>
<graphicElement>
<pen lineStyle="Double"/>
</graphicElement>
</line>
<textField>
<reportElement uuid="094bedd3-551d-42d4-8675-5711d960414e" x="0" y="5" width="555" height="20"/>
<textElement>
<font size="12" isBold="true" pdfFontName="Helvetica-BoldOblique" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{company}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="3e42046a-810f-423f-8134-6b71b4bd0c85" x="0" y="29" width="555" height="1"/>
</line>
<staticText>
<reportElement uuid="afa3900e-e487-4a09-a6f7-989a92a9f1ec" x="0" y="38" width="77" height="20"/>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[IČ]]></text>
</staticText>
<staticText>
<reportElement uuid="496d20e5-929b-4dfd-b770-70ab5c9341f3" x="0" y="58" width="77" height="20"/>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[DIČ]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="f2af95df-0b40-495b-8f54-0e53a1bbdcfb" x="77" y="58" width="128" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{dic}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="b88df725-f080-427b-b977-ca7d6c379f41" x="0" y="78" width="77" height="20"/>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[Město]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="627a01de-a497-4654-bd3f-250006079b03" x="77" y="78" width="189" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{city}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="93250d5f-6e5a-4bd3-860f-0778a1464ae2" x="0" y="98" width="77" height="20"/>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[Ulice]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="8e4c5326-3905-450a-9ccd-e10b265c8769" x="77" y="98" width="189" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{street}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="a91717ea-dca2-43f9-bf8c-656f60f77f2a" x="0" y="118" width="77" height="20"/>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[Číslo]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="6ee787ba-a11c-477f-a7b3-499bdb3206eb" x="77" y="118" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{houseNumber}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="b474f469-5635-48b7-ae02-7670081e1723" x="0" y="138" width="77" height="20"/>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[PSČ]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="bf63acbb-5367-4292-a3d3-863cce98b1a3" x="77" y="138" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{zipCode}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="f50e23b7-7daa-430b-bd18-290bdb839dc8" x="284" y="38" width="100" height="20"/>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[Kontaktní osoba]]></text>
</staticText>
<staticText>
<reportElement uuid="ad4dcc95-d692-4dc5-acd1-b29aeb3f27f1" x="284" y="58" width="100" height="20"/>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[Web]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="a39b1341-2a2a-418b-beba-429521c24b77" x="384" y="58" width="171" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{web}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="20b19927-0028-4fa1-ae21-014546d2d1ee" x="284" y="78" width="100" height="20"/>
<textElement>
<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[E-mail]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="e9ab750f-9e93-4bb7-b450-0024bdd116c9" x="384" y="78" width="171" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{email}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="288a7d64-7aff-4358-aa3e-47988849915b" x="384" y="38" width="171" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{contactName}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="5bbc5045-e31c-40f1-8cdf-ad654441862b" x="77" y="38" width="125" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{ic}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="14" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="16" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="16" splitType="Stretch"/>
</summary>
</jasperReport>

@ -18,6 +18,11 @@
<value>false</value> <value>false</value>
</library-property> </library-property>
<system-config>
<label-location>/WEB-INF/locales/zk-label.properties</label-location>
<label-location>/WEB-INF/locales/columns.properties</label-location>
</system-config>
<language-config> <language-config>
<addon-uri>/WEB-INF/lang-addons/mapa-lang-addon.xml</addon-uri> <addon-uri>/WEB-INF/lang-addons/mapa-lang-addon.xml</addon-uri>
<addon-uri>/WEB-INF/lang-addons/ckez-bind-lang-addon.xml</addon-uri> <addon-uri>/WEB-INF/lang-addons/ckez-bind-lang-addon.xml</addon-uri>

@ -1,10 +0,0 @@
<?page title="${labels.ReportReport}" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="${labels.ReportReport}" border="normal" closable="true" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.ReportVM')">
<toolbar>
<toolbarbutton image="/img/send.png" tooltiptext="${labels.ReportSend}"/>
</toolbar>
<iframe width="800px" height="680px" src="/api/report.pdf"/>
</window>
</zk>

@ -1,32 +0,0 @@
<?page title="${labels.ReportReports}" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="reportDialog" title="${labels.ReportReports}" border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.ReportDialogVM')"
closable="true" width="550px">
<hbox>
<listbox model="@load(vm.reports)" width="250px" height="350px" selectedItem="@bind(vm.selected)">
<template name="model">
<listitem>
<listcell><label value="@load(each.name)"/></listcell>
</listitem>
</template>
</listbox>
<groupbox mold="3d" closable="false" width="270px">
<caption label="${labels.ReportOptions}"></caption>
<hbox>
<label value="${labels.ReportTitle}"/> <textbox value="@bind(vm.reportDefinition.reportTitle)"/>
</hbox>
<vbox children="@load(vm.columns.checks)">
<template name="children">
<checkbox label="@load(each.member)" checked="@bind(each.checked)"/>
</template>
</vbox>
</groupbox>
</hbox>
<hbox>
<button label="${labels.ReportPrint}" onClick="@command('print', window=reportDialog)"/> <button label="${labels.ButtonStorno}" onClick="reportDialog.detach()"/>
</hbox>
</window>
</zk>

@ -0,0 +1,15 @@
<?page title="Column Select" contentType="text/html;charset=UTF-8"?>
<zk>
<groupbox mold="3d" closable="false" width="270px" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vmOpt') @init('info.bukova.isspst.ui.reporting.ColSelectVM')">
<caption label="${labels.ReportOptions}"></caption>
<hbox>
<label value="${labels.ReportTitle}"/> <textbox value="@bind(vmOpt.reportDefinition.reportTitle)"/>
</hbox>
<vbox children="@load(vmOpt.columns.checks)">
<template name="children">
<checkbox label="@load(each.member) @converter(vmOpt.locConverter)" checked="@bind(each.checked)"/>
</template>
</vbox>
</groupbox>
</zk>

@ -0,0 +1,6 @@
<?page title="No Options" contentType="text/html;charset=UTF-8"?>
<zk>
<div>
<label value="${labels.ReportNoOptions}"/>
</div>
</zk>

@ -0,0 +1,11 @@
<?page title="${labels.ReportReport}" contentType="text/html;charset=UTF-8"?>
<zk>
<window border="normal" closable="true" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.reporting.ReportVM')">
<caption src="/img/print.png" zclass="form-caption" label="${labels.ReportReport}" />
<toolbar>
<toolbarbutton image="/img/send.png" tooltiptext="${labels.ReportSend}"/>
</toolbar>
<iframe width="800px" height="660px" src="/api/report.pdf"/>
</window>
</zk>

@ -0,0 +1,23 @@
<?page title="${labels.ReportReports}" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="reportDialog" border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.reporting.ReportDialogVM')"
closable="true" width="550px">
<caption src="/img/print.png" zclass="form-caption" label="${labels.ReportReports}" />
<hbox>
<listbox model="@load(vm.reports)" width="250px" height="350px" selectedItem="@bind(vm.selected)">
<template name="model">
<listitem disabled="@load(each.singleRecord and empty vm.singleObject)">
<listcell><label value="@load(each.name)"/></listcell>
</listitem>
</template>
</listbox>
<include src="@load(vm.optionsForm)"/>
</hbox>
<hbox>
<button image="/img/print-button.png" label="${labels.ReportPrint}" onClick="@command('print', window=reportDialog)" sclass="nicebutton" disabled="@bind(empty vm.selected)"/> <button image="~./zul/img/misc/drag-disallow.png" label="${labels.ButtonStorno}" onClick="reportDialog.detach()" sclass="nicebutton"/>
</hbox>
</window>
</zk>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Loading…
Cancel
Save