Yaniv Dary has uploaded a new change for review.

Change subject: reports: fixed date display on br16 (#863763)
......................................................................

reports: fixed date display on br16 (#863763)

Had missing field in date display that caused error.
Changed query to contain the field required.

bug-url: https://bugzilla.redhat.com/857683

Change-Id: I74a083e6a6c1d78d3f0d09da8b0e2ab7b8cf23e7
Signed-off-by: Yaniv Dary <yd...@redhat.com>
---
M 
reports/repository_files/resources/Reports/Trend/Virtual_machines/multiple_vms_resource_usage_over_time_br16_files/report3.jrxml.data
1 file changed, 31 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/58/8458/1

diff --git 
a/reports/repository_files/resources/Reports/Trend/Virtual_machines/multiple_vms_resource_usage_over_time_br16_files/report3.jrxml.data
 
b/reports/repository_files/resources/Reports/Trend/Virtual_machines/multiple_vms_resource_usage_over_time_br16_files/report3.jrxml.data
index 8e6bf20..d842d73 100644
--- 
a/reports/repository_files/resources/Reports/Trend/Virtual_machines/multiple_vms_resource_usage_over_time_br16_files/report3.jrxml.data
+++ 
b/reports/repository_files/resources/Reports/Trend/Virtual_machines/multiple_vms_resource_usage_over_time_br16_files/report3.jrxml.data
@@ -1,10 +1,10 @@
 <?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="report1" 
language="groovy" pageWidth="830" pageHeight="156" orientation="Landscape" 
columnWidth="830" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" 
resourceBundle="ovirt_reports_bundle" whenResourceMissingType="Error">
+<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="report1" 
language="groovy" pageWidth="830" pageHeight="156" orientation="Landscape" 
columnWidth="830" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" 
resourceBundle="ovirt_reports_bundle" whenResourceMissingType="Error" 
uuid="8c4abf16-206a-425d-b369-d7ff61572001">
     <property name="ireport.zoom" value="1.0"/>
     <property name="ireport.x" value="0"/>
     <property name="ireport.y" value="0"/>
     <property name="ireport.jasperserver.reportUnit" 
value="/Reports/Trend/Virtual_machines/multiple_vms_resource_usage_over_time_br16"/>
-    <property name="ireport.jasperserver.url" 
value="http://localhost:8080/jasperserver/services/repository"/>
+    <property name="ireport.jasperserver.url" 
value="http://localhost:8080/jasperserver-pro/services/repository"/>
     <parameter name="is_deleted" class="java.lang.String">
         <defaultValueExpression><![CDATA["AND delete_date IS 
NULL"]]></defaultValueExpression>
     </parameter>
@@ -57,11 +57,10 @@
                      FROM v3_0_datacenter_configuration_view as d
                     GROUP BY d.datacenter_id)) as datacenter_delete_date,
         CASE
-            WHEN $P{P_Period} = 'Daily' THEN $P{P_Start_Date}
-            WHEN $P{P_Period} = 'Monthly' THEN $P{P_Start_Date} || ' - ' || 
CAST(CAST(cast($P{P_Start_Date} as date) + interval '1 month' - interval '1 
day' as date) as varchar)
-            WHEN $P{P_Period} = 'Quarterly' THEN $P{P_Start_Date} || ' - ' || 
CAST(CAST(cast($P{P_Start_Date} as date) + interval '3 month' - interval '1 
day' as date) as varchar)
-            WHEN $P{P_Period} = 'Yearly' THEN $P{P_Start_Date} || ' - ' || 
CAST(CAST(cast($P{P_Start_Date} as date) + interval '1 year' - interval '1 day' 
as date) as varchar)
-        END as display_dates
+            WHEN $P{P_Period} = 'Monthly' THEN CAST(cast($P{P_Start_Date} as 
date) + interval '1 month' - interval '1 day' as date)
+            WHEN $P{P_Period} = 'Quarterly' THEN CAST(cast($P{P_Start_Date} as 
date) + interval '3 month' - interval '1 day' as date)
+            WHEN $P{P_Period} = 'Yearly' THEN CAST(cast($P{P_Start_Date} as 
date) + interval '1 year' - interval '1 day' as date)
+        END as end_date
 FROM v3_0_vm_configuration_view
 WHERE     $X{IN, cast(v3_0_vm_configuration_view.vm_id as varchar), 
P_VM_ListID}
     and history_id in (SELECT max(a.history_id)
@@ -78,7 +77,7 @@
     <field name="vm_type" class="java.lang.String"/>
     <field name="datacenter_name" class="java.lang.String"/>
     <field name="datacenter_delete_date" class="java.sql.Date"/>
-    <field name="display_dates" class="java.lang.String"/>
+    <field name="end_date" class="java.sql.Date"/>
     <variable name="datacenter_star" class="java.lang.String" resetType="None">
         <variableExpression><![CDATA[$F{datacenter_delete_date} != null ? "*" 
: ""]]></variableExpression>
     </variable>
@@ -95,7 +94,7 @@
     <title>
         <band height="133" splitType="Stretch">
             <frame>
-                <reportElement mode="Opaque" x="0" y="30" width="828" 
height="40"/>
+                <reportElement uuid="b14cecc9-70c0-4918-b63f-0befd9a385f8" 
mode="Opaque" x="0" y="30" width="828" height="40"/>
                 <box>
                     <pen lineWidth="1.0" lineColor="#CCCCCC"/>
                     <topPen lineWidth="1.0" lineColor="#CCCCCC"/>
@@ -104,23 +103,23 @@
                     <rightPen lineWidth="1.0" lineColor="#CCCCCC"/>
                 </box>
                 <textField>
-                    <reportElement positionType="Float" x="83" y="20" 
width="216" height="20"/>
+                    <reportElement uuid="e2fb1d00-0ad8-4c40-8a43-38acaeb14519" 
positionType="Float" x="83" y="20" width="216" height="20"/>
                     <textElement textAlignment="Justified" 
verticalAlignment="Middle" markup="html">
                         <font fontName="DejaVu Sans" size="11" isBold="false"/>
                     </textElement>
-                    <textFieldExpression 
class="java.lang.String"><![CDATA["<b>" + $R{full.details.period} + ":</b> " + 
$P{P_Period}]]></textFieldExpression>
+                    <textFieldExpression><![CDATA["<b>" + 
$R{full.details.period} + ":</b> " + $P{P_Period}]]></textFieldExpression>
                     
<hyperlinkTooltipExpression><![CDATA[$P{P_Period}]]></hyperlinkTooltipExpression>
                 </textField>
                 <textField>
-                    <reportElement x="83" y="0" width="216" height="20"/>
+                    <reportElement uuid="1a6af3ea-adaf-4fac-b4e5-c624bb1cff2a" 
x="83" y="0" width="216" height="20"/>
                     <textElement verticalAlignment="Middle" markup="html">
                         <font fontName="DejaVu Sans" size="11" isBold="false" 
pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                     </textElement>
-                    <textFieldExpression 
class="java.lang.String"><![CDATA["<b>" + $R{full.details.datacenter} + ": 
</b>" + $F{datacenter_name} + $V{datacenter_star}]]></textFieldExpression>
+                    <textFieldExpression><![CDATA["<b>" + 
$R{full.details.datacenter} + ": </b>" + $F{datacenter_name} + 
$V{datacenter_star}]]></textFieldExpression>
                     <hyperlinkTooltipExpression><![CDATA[$F{datacenter_name} + 
$V{datacenter_star}]]></hyperlinkTooltipExpression>
                 </textField>
                 <textField>
-                    <reportElement positionType="Float" x="328" y="20" 
width="253" height="20"/>
+                    <reportElement uuid="94282794-796d-479d-83d4-1f67119065da" 
positionType="Float" x="328" y="20" width="253" height="20"/>
                     <textElement textAlignment="Justified" 
verticalAlignment="Middle" markup="html">
                         <font fontName="DejaVu Sans" size="11" isBold="false"/>
                     </textElement>
@@ -128,45 +127,45 @@
                     <hyperlinkTooltipExpression><![CDATA[$P{P_Period} == 
"Daily" ? DateFormat.getDateInstance(DateFormat.SHORT, 
$P{REPORT_LOCALE}).format($P{P_Start_Date}) : 
DateFormat.getDateInstance(DateFormat.SHORT, 
$P{REPORT_LOCALE}).format($P{P_Start_Date}) + " - " + 
DateFormat.getDateInstance(DateFormat.SHORT, 
$P{REPORT_LOCALE}).format($F{end_date})]]></hyperlinkTooltipExpression>
                 </textField>
                 <textField>
-                    <reportElement positionType="Float" x="328" y="0" 
width="253" height="20"/>
+                    <reportElement uuid="a60ae6fd-8747-49fa-afa9-3e26007f6fd6" 
positionType="Float" x="328" y="0" width="253" height="20"/>
                     <textElement textAlignment="Justified" 
verticalAlignment="Middle" markup="html">
                         <font fontName="DejaVu Sans" size="11" isBold="false"/>
                     </textElement>
-                    <textFieldExpression 
class="java.lang.String"><![CDATA[$F{cluster_name} != "all" ? "<b>" + 
$R{full.details.cluster} + ":</b> " + $F{cluster_name} + $V{cluster_star} : 
"<b>" + $R{full.details.cluster} + ":</b> "+ 
$R{full.details.all}]]></textFieldExpression>
+                    <textFieldExpression><![CDATA[$F{cluster_name} != "all" ? 
"<b>" + $R{full.details.cluster} + ":</b> " + $F{cluster_name} + 
$V{cluster_star} : "<b>" + $R{full.details.cluster} + ":</b> "+ 
$R{full.details.all}]]></textFieldExpression>
                     <hyperlinkTooltipExpression><![CDATA[$F{cluster_name} != 
"all" ? $F{cluster_name} + $V{cluster_star} : 
$R{full.details.all}]]></hyperlinkTooltipExpression>
                 </textField>
                 <textField>
-                    <reportElement positionType="Float" x="591" y="0" 
width="162" height="20"/>
+                    <reportElement uuid="3b4cec65-cf28-485c-abab-94ba380ab83e" 
positionType="Float" x="591" y="0" width="162" height="20"/>
                     <textElement textAlignment="Justified" 
verticalAlignment="Middle" markup="html">
                         <font fontName="DejaVu Sans" size="11" isBold="false"/>
                     </textElement>
-                    <textFieldExpression 
class="java.lang.String"><![CDATA[$F{vm_type} != "All" ? "<b>" + 
$R{full.details.vm.type} + ":</b> " + $F{vm_type} : "<b>" + 
$R{full.details.vm.type} + ":</b> " + 
$R{full.details.all}]]></textFieldExpression>
+                    <textFieldExpression><![CDATA[$F{vm_type} != "All" ? "<b>" 
+ $R{full.details.vm.type} + ":</b> " + $F{vm_type} : "<b>" + 
$R{full.details.vm.type} + ":</b> " + 
$R{full.details.all}]]></textFieldExpression>
                     <hyperlinkTooltipExpression><![CDATA[$F{vm_type} != "All" 
? $F{vm_type} : $R{full.details.all}]]></hyperlinkTooltipExpression>
                 </textField>
                 <textField>
-                    <reportElement mode="Opaque" x="2" y="2" width="69" 
height="36" forecolor="#666666" backcolor="#E6E6E6"/>
+                    <reportElement uuid="21dd0bc3-4a14-409a-a050-d685f28e893a" 
mode="Opaque" x="2" y="2" width="69" height="36" forecolor="#666666" 
backcolor="#E6E6E6"/>
                     <textElement textAlignment="Left" 
verticalAlignment="Middle" markup="none">
                         <font fontName="DejaVu Sans" size="13" isBold="true"/>
                     </textElement>
-                    <textFieldExpression 
class="java.lang.String"><![CDATA[$R{full.details.criteria} + 
":"]]></textFieldExpression>
+                    <textFieldExpression><![CDATA[$R{full.details.criteria} + 
":"]]></textFieldExpression>
                 </textField>
             </frame>
             <textField evaluationTime="Report" isBlankWhenNull="false">
-                <reportElement x="0" y="0" width="830" height="25" 
forecolor="#666666"/>
+                <reportElement uuid="ba4362b6-aee3-4186-aef6-a54d122e511d" 
x="0" y="0" width="830" height="25" forecolor="#666666"/>
                 <textElement textAlignment="Left" verticalAlignment="Top" 
markup="html">
                     <font fontName="DejaVu Sans" size="17" isBold="false" 
isItalic="false" isUnderline="false" isStrikeThrough="false"/>
                 </textElement>
-                <textFieldExpression 
class="java.lang.String"><![CDATA[$R{br16.title}]]></textFieldExpression>
+                
<textFieldExpression><![CDATA[$R{br16.title}]]></textFieldExpression>
             </textField>
             <textField>
-                <reportElement mode="Opaque" x="0" y="89" width="272" 
height="16" forecolor="#3A5E75"/>
+                <reportElement uuid="635047e8-d8ec-4b6f-ba49-7628f9ab62b6" 
mode="Opaque" x="0" y="89" width="272" height="16" forecolor="#3A5E75"/>
                 <textElement textAlignment="Left" verticalAlignment="Middle" 
markup="none">
                     <font fontName="DejaVu Sans" size="13" isBold="true"/>
                 </textElement>
-                <textFieldExpression 
class="java.lang.String"><![CDATA[$R{full.details.vms.names}]]></textFieldExpression>
+                
<textFieldExpression><![CDATA[$R{full.details.vms.names}]]></textFieldExpression>
             </textField>
             <frame>
-                <reportElement mode="Opaque" x="0" y="106" width="828" 
height="27"/>
+                <reportElement uuid="c2b65c59-e9e1-47d8-add1-3ca1e79ffed6" 
mode="Opaque" x="0" y="106" width="828" height="27"/>
                 <box>
                     <pen lineWidth="1.0" lineColor="#CCCCCC"/>
                     <topPen lineWidth="1.0" lineColor="#CCCCCC"/>
@@ -175,16 +174,16 @@
                     <rightPen lineWidth="1.0" lineColor="#CCCCCC"/>
                 </box>
                 <textField evaluationTime="Report">
-                    <reportElement x="10" y="0" width="818" height="26"/>
+                    <reportElement uuid="33d567d4-800f-4e30-aec6-840ebac51d4c" 
x="10" y="0" width="818" height="26"/>
                     <textElement verticalAlignment="Middle">
                         <font fontName="DejaVu Sans" size="11"/>
                     </textElement>
-                    <textFieldExpression 
class="java.lang.String"><![CDATA[$V{var_vmlist}.substring(0,$V{var_vmlist}.length()
 - 2)]]></textFieldExpression>
+                    
<textFieldExpression><![CDATA[$V{var_vmlist}.substring(0,$V{var_vmlist}.length()
 - 2)]]></textFieldExpression>
                     
<hyperlinkTooltipExpression><![CDATA[$V{var_vmlist}.substring(0,$V{var_vmlist}.length()
 - 2)]]></hyperlinkTooltipExpression>
                 </textField>
             </frame>
             <staticText>
-                <reportElement x="3" y="72" width="5" height="16" 
forecolor="#666666">
+                <reportElement uuid="7a6ae5ee-c4fa-4ee1-aa8e-e407d47f12ca" 
x="3" y="72" width="5" height="16" forecolor="#666666">
                     <printWhenExpression><![CDATA[$F{cluster_delete_date} != 
null || $F{datacenter_delete_date} != null]]></printWhenExpression>
                 </reportElement>
                 <textElement verticalAlignment="Middle">
@@ -193,20 +192,20 @@
                 <text><![CDATA[*]]></text>
             </staticText>
             <textField>
-                <reportElement x="27" y="72" width="735" height="13" 
forecolor="#666666"/>
+                <reportElement uuid="f57aa72f-aeaa-4188-b3e4-da09f8721fed" 
x="27" y="72" width="735" height="13" forecolor="#666666"/>
                 <textElement markup="html">
                     <font fontName="DejaVu Sans"/>
                 </textElement>
-                <textFieldExpression 
class="java.lang.String"><![CDATA[$F{cluster_delete_date} != null ?
+                <textFieldExpression><![CDATA[$F{cluster_delete_date} != null ?
 $F{datacenter_delete_date} != null ? 
msg($R{full.details.deleted.comment.datacenter.and.cluster}, 
DateFormat.getDateInstance(DateFormat.SHORT, 
$P{REPORT_LOCALE}).format($F{datacenter_delete_date}), 
DateFormat.getDateInstance(DateFormat.SHORT, 
$P{REPORT_LOCALE}).format($F{cluster_delete_date})) :
 msg($R{full.details.deleted.comment.cluster}, 
DateFormat.getDateInstance(DateFormat.SHORT, 
$P{REPORT_LOCALE}).format($F{cluster_delete_date})) :
 $F{datacenter_delete_date} != null ? 
msg($R{full.details.deleted.comment.datacenter}, 
DateFormat.getDateInstance(DateFormat.SHORT, 
$P{REPORT_LOCALE}).format($F{datacenter_delete_date})) : 
""]]></textFieldExpression>
             </textField>
             <image>
-                <reportElement x="10" y="72" width="10" height="11">
+                <reportElement uuid="f493c996-4ba6-4846-b775-a0e9000eb0b7" 
x="10" y="72" width="10" height="11">
                     <printWhenExpression><![CDATA[$F{cluster_delete_date} != 
null || $F{datacenter_delete_date} != null]]></printWhenExpression>
                 </reportElement>
-                <imageExpression 
class="java.lang.String"><![CDATA["repo:trash-icon"]]></imageExpression>
+                
<imageExpression><![CDATA["repo:trash-icon"]]></imageExpression>
             </image>
         </band>
     </title>


--
To view, visit http://gerrit.ovirt.org/8458
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74a083e6a6c1d78d3f0d09da8b0e2ab7b8cf23e7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-reports
Gerrit-Branch: master
Gerrit-Owner: Yaniv Dary <yd...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to