Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
New sample label report and additional validation on sample label printing.
  • Loading branch information
C4J committed Feb 20, 2024
1 parent 068ee12 commit f407cad
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 0 deletions.
Binary file modified b6/commander4j.jar
Binary file not shown.
102 changes: 102 additions & 0 deletions b6/reports/qm_sample_label.jrxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.21.2.final using JasperReports Library version 6.21.2-8434a0bd7c3bbc37cbf916f2968d35e4b165821a -->
<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="qm_sample_label" pageWidth="289" pageHeight="107" orientation="Landscape" columnWidth="287" leftMargin="1" rightMargin="1" topMargin="1" bottomMargin="1" uuid="cc7a55b2-fcc7-403d-ac2e-317e3f2805f9">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mySQL"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<queryString language="SQL">
<![CDATA[select * from app_qm_sample where sample_id = 1735453]]>
</queryString>
<field name="SAMPLE_ID" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.name" value="SAMPLE_ID"/>
<property name="com.jaspersoft.studio.field.label" value="SAMPLE_ID"/>
<property name="com.jaspersoft.studio.field.tree.path" value="app_qm_sample"/>
</field>
<field name="PROCESS_ORDER" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="PROCESS_ORDER"/>
<property name="com.jaspersoft.studio.field.label" value="PROCESS_ORDER"/>
<property name="com.jaspersoft.studio.field.tree.path" value="app_qm_sample"/>
</field>
<field name="MATERIAL" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="MATERIAL"/>
<property name="com.jaspersoft.studio.field.label" value="MATERIAL"/>
<property name="com.jaspersoft.studio.field.tree.path" value="app_qm_sample"/>
</field>
<field name="SAMPLE_DATE" class="java.sql.Timestamp">
<property name="com.jaspersoft.studio.field.name" value="SAMPLE_DATE"/>
<property name="com.jaspersoft.studio.field.label" value="SAMPLE_DATE"/>
<property name="com.jaspersoft.studio.field.tree.path" value="app_qm_sample"/>
</field>
<field name="USER_DATA_1" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="USER_DATA_1"/>
<property name="com.jaspersoft.studio.field.label" value="USER_DATA_1"/>
<property name="com.jaspersoft.studio.field.tree.path" value="app_qm_sample"/>
</field>
<field name="USER_DATA_2" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="USER_DATA_2"/>
<property name="com.jaspersoft.studio.field.label" value="USER_DATA_2"/>
<property name="com.jaspersoft.studio.field.tree.path" value="app_qm_sample"/>
</field>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="105" splitType="Stretch">
<componentElement>
<reportElement x="45" y="53" width="226" height="50" uuid="cbdff917-a86c-4267-bd27-1ecaca57aaf7"/>
<jr:Code128 xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" moduleWidth="2.0">
<jr:codeExpression><![CDATA[$F{SAMPLE_ID}]]></jr:codeExpression>
</jr:Code128>
</componentElement>
<textField>
<reportElement x="64" y="7" width="66" height="12" uuid="ead650ed-0b92-47e9-9dab-ba4b54b8da8a"/>
<textFieldExpression><![CDATA[$F{PROCESS_ORDER}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="7" width="60" height="12" uuid="2f862638-6f38-431e-9acf-0fcf9aa9429a">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right"/>
<text><![CDATA[Order : ]]></text>
</staticText>
<staticText>
<reportElement x="133" y="7" width="60" height="12" uuid="2536785f-57f3-4f2f-a588-800e76548c37">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right"/>
<text><![CDATA[Material : ]]></text>
</staticText>
<textField>
<reportElement x="200" y="7" width="66" height="12" uuid="99ffe186-402f-45a2-bc44-74057ca85a6c"/>
<textFieldExpression><![CDATA[$F{MATERIAL}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="64" y="22" width="116" height="12" uuid="220d279d-d262-4769-8db4-38db853dc618"/>
<textFieldExpression><![CDATA[$F{SAMPLE_DATE}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="4" y="22" width="60" height="12" uuid="701fd362-3765-4283-a5a2-7e682e82bff8">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right"/>
<text><![CDATA[Date :]]></text>
</staticText>
<textField>
<reportElement x="64" y="36" width="66" height="12" uuid="2222de7f-f06a-48eb-afad-6bf233979e11"/>
<textFieldExpression><![CDATA[$F{USER_DATA_1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="200" y="36" width="66" height="12" uuid="fa3d81b6-a79f-4674-a74b-1766150ff653"/>
<textFieldExpression><![CDATA[$F{USER_DATA_2}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
15 changes: 15 additions & 0 deletions b6/src/com/commander4j/app/JInternalFrameQMSampleLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.sql.PreparedStatement;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;
import java.util.LinkedList;

import javax.swing.ButtonGroup;
Expand Down Expand Up @@ -79,6 +80,8 @@
import com.commander4j.util.JDateControl;
import com.commander4j.util.JPrint;
import com.commander4j.util.JUtility;
import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent;

/**
* The JInternalFrameQMSampleLabel is used printing sample labels and populating
Expand Down Expand Up @@ -749,6 +752,18 @@ public void keyReleased(KeyEvent e)
desktopPane.add(lblStatusBar);

sampleDateTime = new JDateControl();
sampleDateTime.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
Date selected = sampleDateTime.getDate();
Date current = JUtility.getSQLDateTime();
if (selected.after(current))
{
sampleDateTime.setDate(current);
}

}
});

sampleDateTime.setEnabled(false);
sampleDateTime.setBounds(417, 8, 128, 25);
desktopPane.add(sampleDateTime);
Expand Down
Loading

0 comments on commit f407cad

Please sign in to comment.