changeset 8438:9ab8b1146ac4

Adapt PDF-export to new columns in bed differences result.
author "Tom Gottfried <tom@intevation.de>"
date Mon, 20 Oct 2014 16:13:26 +0200
parents 4fd063703487
children d1c9eea8aec5
files artifacts/doc/conf/jasper/beddifference.jasper artifacts/doc/conf/jasper/beddifference.jrxml artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java
diffstat 4 files changed, 61 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
Binary file artifacts/doc/conf/jasper/beddifference.jasper has changed
--- a/artifacts/doc/conf/jasper/beddifference.jrxml	Mon Oct 20 14:22:51 2014 +0200
+++ b/artifacts/doc/conf/jasper/beddifference.jrxml	Mon Oct 20 16:13:26 2014 +0200
@@ -12,11 +12,15 @@
 	<field name="diffheader" class="java.lang.String"/>
 	<field name="diffpairheader" class="java.lang.String"/>
 	<field name="diffpair" class="java.lang.String"/>
-	<field name="morph1header" class="java.lang.String"/>
-	<field name="morph1" class="java.lang.String"/>
-	<field name="morph2header" class="java.lang.String"/>
-	<field name="morph2" class="java.lang.String"/>
+	<field name="sounding1header" class="java.lang.String"/>
+	<field name="sounding1" class="java.lang.String"/>
+	<field name="sounding2header" class="java.lang.String"/>
+	<field name="sounding2" class="java.lang.String"/>
 	<field name="kmheader" class="java.lang.String"/>
+	<field name="gap1header" class="java.lang.String"/>
+	<field name="gap1" class="java.lang.String"/>
+	<field name="gap2header" class="java.lang.String"/>
+	<field name="gap2" class="java.lang.String"/>
 	<background>
 		<band splitType="Stretch"/>
 	</background>
@@ -86,24 +90,34 @@
 				<textFieldExpression><![CDATA[$F{kmheader}]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement x="167" y="0" width="96" height="20"/>
+				<reportElement x="174" y="0" width="75" height="19"/>
 				<textElement markup="none"/>
 				<textFieldExpression><![CDATA[$F{diffheader}]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement x="54" y="0" width="113" height="19"/>
+				<reportElement x="54" y="0" width="120" height="19"/>
 				<textElement/>
 				<textFieldExpression><![CDATA[$F{diffpairheader}]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement x="263" y="0" width="123" height="20"/>
+				<reportElement x="249" y="1" width="75" height="19"/>
 				<textElement/>
-				<textFieldExpression><![CDATA[$F{morph1header}]]></textFieldExpression>
+				<textFieldExpression><![CDATA[$F{sounding1header}]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement x="386" y="0" width="128" height="19"/>
+				<reportElement x="324" y="0" width="75" height="19"/>
 				<textElement/>
-				<textFieldExpression><![CDATA[$F{morph2header}]]></textFieldExpression>
+				<textFieldExpression><![CDATA[$F{sounding2header}]]></textFieldExpression>
+			</textField>
+			<textField>
+				<reportElement x="399" y="1" width="58" height="19"/>
+				<textElement/>
+				<textFieldExpression><![CDATA[$F{gap1header}]]></textFieldExpression>
+			</textField>
+			<textField>
+				<reportElement x="457" y="0" width="58" height="19"/>
+				<textElement/>
+				<textFieldExpression><![CDATA[$F{gap2header}]]></textFieldExpression>
 			</textField>
 		</band>
 	</columnHeader>
@@ -115,24 +129,34 @@
 				<textFieldExpression><![CDATA[$F{km}]]></textFieldExpression>
 			</textField>
 			<textField isBlankWhenNull="true">
-				<reportElement x="167" y="0" width="96" height="14"/>
+				<reportElement x="174" y="0" width="75" height="14"/>
 				<textElement/>
 				<textFieldExpression><![CDATA[$F{diff}]]></textFieldExpression>
 			</textField>
 			<textField isBlankWhenNull="true">
-				<reportElement x="54" y="0" width="113" height="14"/>
+				<reportElement x="54" y="0" width="120" height="14"/>
 				<textElement/>
 				<textFieldExpression><![CDATA[$F{diffpair}]]></textFieldExpression>
 			</textField>
 			<textField isBlankWhenNull="true">
-				<reportElement x="263" y="0" width="123" height="14"/>
+				<reportElement x="249" y="0" width="75" height="14"/>
 				<textElement/>
-				<textFieldExpression><![CDATA[$F{morph1}]]></textFieldExpression>
+				<textFieldExpression><![CDATA[$F{sounding1}]]></textFieldExpression>
 			</textField>
 			<textField isBlankWhenNull="true">
-				<reportElement x="386" y="0" width="128" height="14"/>
+				<reportElement x="324" y="0" width="75" height="14"/>
 				<textElement/>
-				<textFieldExpression><![CDATA[$F{morph2}]]></textFieldExpression>
+				<textFieldExpression><![CDATA[$F{sounding2}]]></textFieldExpression>
+			</textField>
+			<textField isBlankWhenNull="true">
+				<reportElement x="399" y="0" width="58" height="14"/>
+				<textElement/>
+				<textFieldExpression><![CDATA[$F{gap1}]]></textFieldExpression>
+			</textField>
+			<textField isBlankWhenNull="true">
+				<reportElement x="457" y="0" width="58" height="14"/>
+				<textElement/>
+				<textFieldExpression><![CDATA[$F{gap2}]]></textFieldExpression>
 			</textField>
 		</band>
 	</detail>
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java	Mon Oct 20 14:22:51 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java	Mon Oct 20 16:13:26 2014 +0200
@@ -68,6 +68,18 @@
         else if ("diffheader".equals(fieldName)) {
             value = metaData.get("diffheader");
         }
+        else if ("sounding1header".equals(fieldName)) {
+            value = metaData.get("sounding1header");
+        }
+        else if ("sounding2header".equals(fieldName)) {
+            value = metaData.get("sounding2header");
+        }
+        else if ("gap1header".equals(fieldName)) {
+            value = metaData.get("gap1header");
+        }
+        else if ("gap2header".equals(fieldName)) {
+            value = metaData.get("gap2header");
+        }
         else if ("km".equals(fieldName)) {
             value = data.get(index)[0];
         }
@@ -84,10 +96,10 @@
             value = data.get(index)[4];
         }
         else if ("gap1".equals(fieldName)) {
-            value = data.get(index)[3];
+            value = data.get(index)[5];
         }
         else if ("gap2".equals(fieldName)) {
-            value = data.get(index)[4];
+            value = data.get(index)[6];
         }
         return value;
     }
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java	Mon Oct 20 14:22:51 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java	Mon Oct 20 16:13:26 2014 +0200
@@ -164,11 +164,13 @@
         source.addMetaData("differences", StringUtils.join(
                 access.getDifferenceArtifactNamePairs(), "\n"));
 
-        source.addMetaData("kmheader",
-                msg(CSV_HEADER_KM, "km"));
-        source.addMetaData("diffpairheader",
-                msg(CSV_HEADER_DIFF_PAIR, "Difference pair"));
-        source.addMetaData("diffheader", msg(CSV_HEADER_DIFF, "cm"));
+        source.addMetaData("kmheader", msg(CSV_HEADER_KM));
+        source.addMetaData("diffpairheader", msg(CSV_HEADER_DIFF_PAIR));
+        source.addMetaData("diffheader", msg(CSV_HEADER_DIFF));
+        source.addMetaData("sounding1header", msg(CSV_HEADER_SOUNDING1));
+        source.addMetaData("sounding2header", msg(CSV_HEADER_SOUNDING2));
+        source.addMetaData("gap1header", msg(CSV_HEADER_GAP1));
+        source.addMetaData("gap2header", msg(CSV_HEADER_GAP2));
     }
 
 

http://dive4elements.wald.intevation.org