Commit 1d523b8b by Prismana

Fix user report java error

1 parent cf85504a
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.20.0.final using JasperReports Library version 6.20.0-2bc7ab61c56f459e8176eb05c7705e145cd400ad --> <!-- Created with Jaspersoft Studio version 6.20.5.final using JasperReports Library version 6.20.5-3efcf2e67f959db3888d79f73dde2dbd7acb4f8e -->
<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="users" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="cc1a9dab-bb8a-4181-94ac-73c3dc91137c"> <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="users" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="cc1a9dab-bb8a-4181-94ac-73c3dc91137c">
<property name="ireport.zoom" value="1.3310000000000004"/> <property name="ireport.zoom" value="1.3310000000000004"/>
<property name="ireport.x" value="0"/> <property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="New Data Adapter"/> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="DemoAdapter.jrdax"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<parameter name="Judul" class="java.lang.String">
<defaultValueExpression><![CDATA[PEMERINTAH TANGERANG]]></defaultValueExpression>
</parameter>
<parameter name="Logo" class="java.lang.String">
<defaultValueExpression><![CDATA["C:\\Users\\ASUS\\Downloads\\bangkit.png"]]></defaultValueExpression>
</parameter>
<queryString> <queryString>
<![CDATA[SELECT * FROM users]]> <![CDATA[SELECT *
FROM users]]>
</queryString> </queryString>
<field name="userid" class="java.lang.String"/>
<field name="nama" class="java.lang.String"/>
<field name="created" class="java.sql.Timestamp"/>
<field name="disabled" class="java.lang.Integer"/>
<field name="passwd" class="java.lang.String"/>
<field name="id" class="java.lang.Integer"/> <field name="id" class="java.lang.Integer"/>
<field name="kd_kantor" class="java.lang.String"/>
<field name="kd_kanwil" class="java.lang.String"/>
<field name="kd_tp" class="java.lang.String"/>
<field name="kd_kanwil_bank" class="java.lang.String"/>
<field name="kd_kppbb_bank" class="java.lang.String"/>
<field name="kd_bank_tunggal" class="java.lang.String"/>
<field name="kd_bank_persepsi" class="java.lang.String"/>
<field name="nip" class="java.lang.String"/>
<field name="jabatan" class="java.lang.String"/>
<field name="handphone" class="java.lang.String"/>
<field name="token" class="java.lang.String"/>
<field name="security_code" class="java.lang.String"/> <field name="security_code" class="java.lang.String"/>
<field name="last_login_date" class="java.sql.Timestamp"/> <field name="last_login_date" class="java.sql.Timestamp"/>
<field name="user_name" class="java.lang.String"/> <field name="user_name" class="java.lang.String"/>
...@@ -40,7 +32,26 @@ ...@@ -40,7 +32,26 @@
<band splitType="Stretch"/> <band splitType="Stretch"/>
</background> </background>
<title> <title>
<band height="21" splitType="Stretch"/> <band height="73" splitType="Stretch">
<staticText>
<reportElement x="230" y="40" width="130" height="20" uuid="abe9cbb1-2e91-4eb0-b3ee-05e9a967c5f6"/>
<textElement>
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[DAFTAR PARTNER]]></text>
</staticText>
<image>
<reportElement x="10" y="10" width="53" height="58" uuid="3fe2de31-ff3e-4451-8d0d-6b2753184c09"/>
<imageExpression><![CDATA[$P{Logo}]]></imageExpression>
</image>
<textField>
<reportElement x="-20" y="10" width="595" height="30" uuid="00412b89-3587-423f-8aaf-1526e5f32540"/>
<textElement textAlignment="Center">
<font size="20" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{Judul}]]></textFieldExpression>
</textField>
</band>
</title> </title>
<pageHeader> <pageHeader>
<band height="35" splitType="Stretch"/> <band height="35" splitType="Stretch"/>
...@@ -49,28 +60,28 @@ ...@@ -49,28 +60,28 @@
<band height="20" splitType="Stretch"> <band height="20" splitType="Stretch">
<staticText> <staticText>
<reportElement x="0" y="0" width="100" height="20" uuid="45c2cace-4a3f-495c-9002-be2f2ac8eca4"/> <reportElement x="0" y="0" width="100" height="20" uuid="45c2cace-4a3f-495c-9002-be2f2ac8eca4"/>
<textElement> <textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/> <font isBold="true" isUnderline="true"/>
</textElement> </textElement>
<text><![CDATA[User Name]]></text> <text><![CDATA[User Name]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="100" y="0" width="255" height="20" uuid="3a03e8b0-96f7-4754-b00e-ceae1a0e5aa9"/> <reportElement x="100" y="0" width="255" height="20" uuid="3a03e8b0-96f7-4754-b00e-ceae1a0e5aa9"/>
<textElement> <textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/> <font isBold="true" isUnderline="true"/>
</textElement> </textElement>
<text><![CDATA[Email]]></text> <text><![CDATA[Email]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="355" y="0" width="100" height="20" uuid="f19e05c8-f1bf-4d94-927d-07111ed068df"/> <reportElement x="355" y="0" width="100" height="20" uuid="f19e05c8-f1bf-4d94-927d-07111ed068df"/>
<textElement> <textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/> <font isBold="true" isUnderline="true"/>
</textElement> </textElement>
<text><![CDATA[Status]]></text> <text><![CDATA[Status]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="455" y="0" width="100" height="20" uuid="8a8040c2-e6ba-4473-835f-c9cfe3568fb9"/> <reportElement x="455" y="0" width="100" height="20" uuid="8a8040c2-e6ba-4473-835f-c9cfe3568fb9"/>
<textElement> <textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/> <font isBold="true" isUnderline="true"/>
</textElement> </textElement>
<text><![CDATA[Last Login]]></text> <text><![CDATA[Last Login]]></text>
...@@ -81,19 +92,23 @@ ...@@ -81,19 +92,23 @@
<band height="22" splitType="Stretch"> <band height="22" splitType="Stretch">
<textField> <textField>
<reportElement x="0" y="0" width="100" height="20" uuid="aec5f07a-b9fb-4ce1-9e7e-957f6315acb0"/> <reportElement x="0" y="0" width="100" height="20" uuid="aec5f07a-b9fb-4ce1-9e7e-957f6315acb0"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{user_name}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{user_name}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="100" y="0" width="255" height="20" uuid="04eef3a7-87ca-4a27-9392-1368a6ba2fd1"/> <reportElement x="100" y="0" width="255" height="20" uuid="04eef3a7-87ca-4a27-9392-1368a6ba2fd1"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{email}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{email}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="455" y="0" width="100" height="20" uuid="24a12a8f-a1e1-4ae3-adb7-bbcf450560ee"/> <reportElement x="455" y="0" width="100" height="20" uuid="24a12a8f-a1e1-4ae3-adb7-bbcf450560ee"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{registered_date}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{registered_date}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="355" y="2" width="100" height="20" uuid="47051f05-f634-4c32-97cc-ce9af7b8f382"/> <reportElement x="355" y="0" width="100" height="20" uuid="47051f05-f634-4c32-97cc-ce9af7b8f382"/>
<textFieldExpression><![CDATA[$F{status}.equals( 1 ) ? "Aktif" : ""]]></textFieldExpression> <textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{status}]]></textFieldExpression>
</textField> </textField>
</band> </band>
</detail> </detail>
......
from . import Validator
from .. import get_urls
import colander import colander
from deform import FileData, widget from deform import FileData, widget
from opensipkd.tools import mem_tmp_store
from translationstring import TranslationStringFactory from translationstring import TranslationStringFactory
from opensipkd.base.views.dati2 import dati2_widget from opensipkd.base.views.dati2 import dati2_widget
...@@ -8,18 +9,18 @@ from opensipkd.base.views.desa import desa_widget ...@@ -8,18 +9,18 @@ from opensipkd.base.views.desa import desa_widget
from opensipkd.base.views.kecamatan import kecamatan_widget from opensipkd.base.views.kecamatan import kecamatan_widget
from opensipkd.base.views.provinsi import provinsi_widget from opensipkd.base.views.provinsi import provinsi_widget
from opensipkd.models import Partner from opensipkd.models import Partner
from . import Validator from opensipkd.tools import mem_tmp_store
from .. import get_urls
_ = TranslationStringFactory('partner')
_ = TranslationStringFactory('partner')
# Email validator
class PartnerEmailValidator(colander.Email, Validator): class PartnerEmailValidator(colander.Email, Validator):
def __init__(self, row): def __init__(self, row):
Validator.__init__(self, row) Validator.__init__(self, row)
colander.Email.__init__(self) colander.Email.__init__(self)
def __call__(self, node, value): def __call__(self, node, value):
def email_found(): def email_found():
data = dict(email=email, rid=found.id, rname=found.nama) data = dict(email=email, rid=found.id, rname=found.nama)
ts = _( ts = _(
...@@ -37,12 +38,10 @@ class PartnerEmailValidator(colander.Email, Validator): ...@@ -37,12 +38,10 @@ class PartnerEmailValidator(colander.Email, Validator):
if found and (not self.row or self.row.email != found.email): if found and (not self.row or self.row.email != found.email):
email_found() email_found()
@colander.deferred @colander.deferred
def partner_email_validator(node, kw): def partner_email_validator(node, kw):
return PartnerEmailValidator(kw['row']) return PartnerEmailValidator(kw['row'])
class PartnerKodeValidator(Validator): class PartnerKodeValidator(Validator):
def __init__(self, row): def __init__(self, row):
Validator.__init__(self, row) Validator.__init__(self, row)
...@@ -62,61 +61,56 @@ class PartnerKodeValidator(Validator): ...@@ -62,61 +61,56 @@ class PartnerKodeValidator(Validator):
if found and (not self.row or self.row.kode != found.kode): if found and (not self.row or self.row.kode != found.kode):
err_found() err_found()
@colander.deferred @colander.deferred
def partner_kode_validator(node, kw): def partner_kode_validator(node, kw):
return PartnerKodeValidator(kw['row']) return PartnerKodeValidator(kw['row'])
# Pengaturan field form html
class NamaSchema(colander.Schema): class NamaSchema(colander.Schema):
kode = colander.SchemaNode( kode = colander.SchemaNode(
colander.String(), colander.String(),
validator=colander.Length(max=32), validator=colander.Length(max=32, max_err='Maksimal 32 karakter'),
oid="kode", oid="kode",
title="Kode", title="Kode",
width="100pt") width="100pt")
nama = colander.SchemaNode( nama = colander.SchemaNode(
colander.String(), colander.String(),
validator=colander.Length(max=128), validator=colander.Length(max=128, max_err='Maksimal 128 karakter'),
oid="nama") oid="nama")
mobile = colander.SchemaNode( mobile = colander.SchemaNode(
colander.String(), colander.String(),
validator=colander.Length(max=16), validator=colander.Length(max=16, max_err='Maksimal 16 karakter angka'),
oid="mobile") oid="mobile")
email = colander.SchemaNode( email = colander.SchemaNode(
colander.String(), colander.String(),
validator=colander.Length(max=40), validator=colander.Length(max=40, max_err='Maksimal 40 karakter'),
oid="email") oid="email")
class PartnerSchema(NamaSchema): class PartnerSchema(NamaSchema):
nip = colander.SchemaNode( nip = colander.SchemaNode(
colander.String(), colander.String(),
missing=colander.drop, missing=colander.drop,
validator=colander.Length(max=32), validator=colander.Length(max=32, max_err='Maksimal 32 digit karakter'),
oid="nip") oid="nip")
npwp = colander.SchemaNode( npwp = colander.SchemaNode(
colander.String(), colander.String(),
missing=colander.drop, missing=colander.drop,
validator=colander.Length(max=32), validator=colander.Length(max=32, max_err='Maksimal 32 digit karakter'),
oid="npwp") oid="npwp")
idcard = colander.SchemaNode( idcard = colander.SchemaNode(
FileData(), FileData(),
widget=widget.FileUploadWidget(mem_tmp_store), widget=widget.FileUploadWidget(mem_tmp_store),
missing=colander.drop, missing=colander.drop,
title="ID Card" title="ID Card")
)
alamat_1 = colander.SchemaNode( alamat_1 = colander.SchemaNode(
colander.String(), colander.String(),
missing=colander.drop, missing=colander.drop,
validator=colander.Length(max=128), validator=colander.Length(max=128, max_err='Maksimal 128 karakter'),
oid="alamat_1") oid="alamat_1")
alamat_2 = colander.SchemaNode( alamat_2 = colander.SchemaNode(
colander.String(), colander.String(),
missing=colander.drop, missing=colander.drop,
validator=colander.Length(max=128), validator=colander.Length(max=128, max_err='Maksimal 128 karakter'),
oid="alamat_2") oid="alamat_2")
# kelurahan = colander.SchemaNode( # kelurahan = colander.SchemaNode(
# colander.String(), # colander.String(),
...@@ -145,9 +139,7 @@ class PartnerSchema(NamaSchema): ...@@ -145,9 +139,7 @@ class PartnerSchema(NamaSchema):
oid="provinsi_id", oid="provinsi_id",
slave="dati2_id", slave="dati2_id",
slave_url="/dati2/select/act?provinsi_id=", slave_url="/dati2/select/act?provinsi_id=",
title="Provinsi", title="Provinsi",)
)
dati2_id = colander.SchemaNode( dati2_id = colander.SchemaNode(
colander.Integer(), colander.Integer(),
widget=dati2_widget, widget=dati2_widget,
...@@ -170,15 +162,14 @@ class PartnerSchema(NamaSchema): ...@@ -170,15 +162,14 @@ class PartnerSchema(NamaSchema):
missing=colander.drop, missing=colander.drop,
title="Desa/Kelurahan", title="Desa/Kelurahan",
oid="desa_id") oid="desa_id")
phone = colander.SchemaNode( phone = colander.SchemaNode(
colander.String(), colander.String(),
validator=colander.Length(max=16), validator=colander.Length(max=16, max_err='Maksimal 16 karakter'),
missing=colander.drop, missing=colander.drop,
oid="phone") oid="phone")
fax = colander.SchemaNode( fax = colander.SchemaNode(
colander.String(), colander.String(),
validator=colander.Length(max=16), validator=colander.Length(max=16, max_err='Maksimal 16 karakter'),
missing=colander.drop, missing=colander.drop,
oid="fax") oid="fax")
mobile = colander.SchemaNode( mobile = colander.SchemaNode(
...@@ -188,16 +179,15 @@ class PartnerSchema(NamaSchema): ...@@ -188,16 +179,15 @@ class PartnerSchema(NamaSchema):
oid="mobile") oid="mobile")
website = colander.SchemaNode( website = colander.SchemaNode(
colander.String(), colander.String(),
validator=colander.Length(max=64), validator=colander.Length(max=64, max_err='Maksimal 64 karakter'),
missing=colander.drop, missing=colander.drop,
oid="website") oid="website")
status = colander.SchemaNode( status = colander.SchemaNode(
colander.Boolean(), colander.Boolean(),
oid="status") oid="status")
def after_bind(self, schema, kwargs): def after_bind(self, schema, kwargs):
request = kwargs["request"] request = kwargs["request"]
prefix = get_urls(request.route_url("home")) prefix = get_urls(request.route_url("home"))
self["provinsi_id"].slave_url = f"{prefix}/dati2/select/act?provinsi_id=" self["provinsi_id"].slave_url = f"{prefix}/dati2/select/act?provinsi_id="
self["dati2_id"].slave_url = f"{prefix}/kecamatan/select/act?dati2_id=" self["dati2_id"].slave_url = f"{prefix}/kecamatan/select/act?dati2_id="
self["kecamatan_id"].slave_url = f"{prefix}/desa/select/act?kecamatan_id=" self["kecamatan_id"].slave_url = f"{prefix}/desa/select/act?kecamatan_id="
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!