Script Results report
I need a sql query that finds the script of a specific name(we can say "testscript" for now) and then gets the computer name and the computer discription that "testscipt" ran on. I only want the comptuters that "testscript" ran on. below is what i have so far that i got from Kace support. it would be even better if i could add a custom inventory field to it as well.
thanks in advanced!
Select K.NAME,
CASE
WHEN KL.STATUS IN (1,2)
THEN 'SUCCESS'
WHEN KL.STATUS IN (3.4)
THEN 'FAILURE'
ELSE
'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN, M.NAME
FROM KBOT_LOG KL
INNER JOIN KBOT K ON
K.ID = KL.KBOT_ID AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M ON
M.ID = KL.MACHINE_ID
order by 1,2,3,4
thanks in advanced!
0 Comments
[ + ] Show comments
Answers (31)
Please log in to answer
Posted by:
dchristian
12 years ago
Something like this?
What fields where you looking to add?
SELECT K.NAME,
CASE
WHEN KL.STATUS IN ( 1, 2 ) THEN 'SUCCESS'
WHEN KL.STATUS IN ( 3.4 ) THEN 'FAILURE'
ELSE 'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN,
M.NAME
FROM KBOT_LOG KL
INNER JOIN KBOT K
ON K.ID = KL.KBOT_ID
AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M
ON M.ID = KL.MACHINE_ID
WHERE K.NAME = 'TestScript'
ORDER BY 1,
2,
3,
4
What fields where you looking to add?
Posted by:
dchristian
12 years ago
What happens when u run this?
SELECT K.NAME,
CASE
WHEN KL.STATUS IN ( 1, 2 ) THEN 'SUCCESS'
WHEN KL.STATUS IN ( 3.4 ) THEN 'FAILURE'
ELSE 'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN,
M.NAME,
MCI.STR_FIELD_VALUE AS CUSTOM_FIELD
FROM KBOT_LOG KL
INNER JOIN KBOT K
ON K.ID = KL.KBOT_ID
AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M
ON M.ID = KL.MACHINE_ID
INNER JOIN MACHINE_CUSTOM_INVENTORY MCI
ON M.ID = MCI.ID
WHERE K.NAME = 'TESTSCRIPT'
ORDER BY 1,
2,
3,
4
Posted by:
dchristian
12 years ago
hmm.... (Scratches head)
Does this give results?
Does this give results?
SELECT K.NAME,
CASE
WHEN KL.STATUS IN ( 1, 2 ) THEN 'SUCCESS'
WHEN KL.STATUS IN ( 3.4 ) THEN 'FAILURE'
ELSE 'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN,
M.NAME,
MCI.STR_FIELD_VALUE AS CUSTOM_FIELD
FROM KBOT_LOG KL
INNER JOIN KBOT K
ON K.ID = KL.KBOT_ID
AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M
ON M.ID = KL.MACHINE_ID
LEFT JOIN MACHINE_CUSTOM_INVENTORY MCI
ON M.ID = MCI.ID
/* WHERE K.NAME = 'TESTSCRIPT' */
ORDER BY 1,
2,
3,
4
Posted by:
mramsdell
12 years ago
Thank you so much for the quick reply. i do need to add a custom inventory field to it. i have the query for it but dont know how to combine it. the query is below.
SELECT (SELECT MACHINE_CUSTOM_INVENTORY.STR_FIELD_VALUE FROM MACHINE_CUSTOM_INVENTORY WHERE MACHINE_CUSTOM_INVENTORY.ID=MACHINE.ID AND MACHINE_CUSTOM_INVENTORY.SOFTWARE_ID=70888) AS MACHINE_CUSTOM_INVENTORY_0_70888 FROM MACHINE
Posted by:
dchristian
12 years ago
SELECT K.NAME,
CASE
WHEN KL.STATUS IN ( 1, 2 ) THEN 'SUCCESS'
WHEN KL.STATUS IN ( 3.4 ) THEN 'FAILURE'
ELSE 'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN,
M.NAME,
MCI.STR_FIELD_VALUE AS CUSTOM_FIELD
FROM KBOT_LOG KL
INNER JOIN KBOT K
ON K.ID = KL.KBOT_ID
AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M
ON M.ID = KL.MACHINE_ID
INNER JOIN MACHINE_CUSTOM_INVENTORY MCI
ON M.ID = MCI.ID
WHERE K.NAME = 'TESTSCRIPT'
AND MCI.SOFTWARE_ID = 70888
ORDER BY 1,
2,
3,
4
Posted by:
GillySpy
12 years ago
Posted by:
mramsdell
12 years ago
Posted by:
sfigg
12 years ago
Guys - I need this same SQL script to run (minus the custom field). So, I've used this - but when I hit "preview", I'm getting a "caught invalid xml string" error. Any ideas? (I'm creating this from classic reports SQL)
Select 'SMART Notebook Shortcuts',
CASE
WHEN KL.STATUS IN (1,2)
THEN 'SUCCESS'
WHEN KL.STATUS IN (3.4)
THEN 'FAILURE'
ELSE
'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN, M.NAME
FROM KBOT_LOG KL
INNER JOIN KBOT K ON
K.ID = KL.KBOT_ID AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M ON
M.ID = KL.MACHINE_ID
order by 1,2,3,4
Select 'SMART Notebook Shortcuts',
CASE
WHEN KL.STATUS IN (1,2)
THEN 'SUCCESS'
WHEN KL.STATUS IN (3.4)
THEN 'FAILURE'
ELSE
'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN, M.NAME
FROM KBOT_LOG KL
INNER JOIN KBOT K ON
K.ID = KL.KBOT_ID AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M ON
M.ID = KL.MACHINE_ID
order by 1,2,3,4
Posted by:
sfigg
12 years ago
Posted by:
dchristian
12 years ago
Posted by:
sfigg
12 years ago
Posted by:
mramsdell
12 years ago
try this
SELECT K.NAME,
CASE
WHEN KL.STATUS IN ( 1, 2 ) THEN 'SUCCESS'
WHEN KL.STATUS IN ( 3.4 ) THEN 'FAILURE'
ELSE 'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN,
M.NAME
FROM KBOT_LOG KL
INNER JOIN KBOT K
ON K.ID = KL.KBOT_ID
AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M
ON M.ID = KL.MACHINE_ID
WHERE K.NAME = 'SMART Notebook Shortcuts'
ORDER BY 1,
2,
3,
4
Posted by:
sfigg
12 years ago
Posted by:
dchristian
12 years ago
Posted by:
sfigg
12 years ago
I deleted the report, then made a new classic SQL report. I copied it into the SQL field again, and this is what I got when I saved it and clicked PDF (am I doing that right? this is my first report I've run this way):
Error Running Report
Exception while running report. net.sf.jasperreports.engine.JRException: Duplicate declaration of field : NAME
Error Running Report
Exception while running report. net.sf.jasperreports.engine.JRException: Duplicate declaration of field : NAME
Posted by:
mramsdell
12 years ago
Posted by:
mramsdell
12 years ago
Looks like you need to create an alias because it uses "name" twice. Try this.
SELECT K.NAME,
CASE
WHEN KL.STATUS IN ( 1, 2 ) THEN 'SUCCESS'
WHEN KL.STATUS IN ( 3.4 ) THEN 'FAILURE'
ELSE 'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN,
M.NAME MACHINE_NAME
FROM KBOT_LOG KL
INNER JOIN KBOT K
ON K.ID = KL.KBOT_ID
AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M
ON M.ID = KL.MACHINE_ID
WHERE K.NAME = 'SMART Notebook Shortcuts'
ORDER BY 1,
2,
3,
4
Posted by:
sfigg
12 years ago
Posted by:
sfigg
12 years ago
Posted by:
sfigg
12 years ago
Posted by:
mramsdell
12 years ago
Posted by:
sfigg
12 years ago
Doesn't work when I hit preview either. I'm just copying the same script from above - which works in regular reports but just not custom. I'm not big on SQL, so I apologize for not being able to really troubleshoot further than what we're kind of already listed here.
Preview shows "caught invalid xml string"
Preview shows "caught invalid xml string"
Posted by:
mramsdell
12 years ago
Posted by:
sfigg
12 years ago
Sure. Here you go (not the smart notebook script - a different one which we're using today)
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
name="landscape"
columnCount="1"
printOrder="Vertical"
orientation="Portrait"
pageWidth="842"
pageHeight="595"
columnWidth="782"
columnSpacing="0"
leftMargin="30"
rightMargin="30"
topMargin="20"
bottomMargin="20"
whenNoDataType="AllSectionsNoDetail"
isTitleNewPage="false"
isSummaryNewPage="false">
<property name="ireport.scriptlethandling" value="0" />
<property name="ireport.encoding" value="UTF-8" />
<import value="java.util.*" />
<import value="net.sf.jasperreports.engine.*" />
<import value="net.sf.jasperreports.engine.data.*" />
<style
name="GroupLabel"
mode="Transparent"
fontName="Arial"
fontSize="10"
forecolor="#FFFFFF"
isBold="true"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false"
/>
<style
name="GroupHeader"
mode="Transparent"
fontName="Arial"
fontSize="10"
forecolor="#FFFFFF"
isBold="true"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false">
<box leftPadding="3"></box>
</style>
<style
name="GroupFooter"
mode="Transparent"
fontName="Arial"
fontSize="10"
forecolor="#e5e5e5"
backcolor="#e5e5e5"
isBold="true"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false">
<box leftPadding="3"></box>
</style>
<style
name="ColumnHeaderFooter"
mode="Transparent"
isDefault="false"
fontName="Arial"
fontSize="10"
forecolor="#FFFFFF"
isBold="true"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false">
<box leftPadding="3"></box>
</style>
<style
name="ColumnHeaderPanel"
isDefault="false"
mode="Opaque"
forecolor="#FFFFFF"
backcolor="#006699"
fill="Solid"
fontName="Arial"
fontSize="10"
isBold="false"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false"
/>
<style
name="GroupHeaderPanel"
isDefault="false"
mode="Opaque"
forecolor="#FFFFFF"
backcolor="#999999"
fill="Solid"
fontName="Arial"
fontSize="10"
isBold="false"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false"
/>
<style
name="ReportHeader"
mode="Transparent"
forecolor="#000000"
isDefault="false"
fontName="Arial"
fontSize="16"
isBold="true"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false">
<box></box>
</style>
<style
name="Detail"
mode="Transparent"
forecolor="#000000"
isDefault="false"
fontName="Arial"
fontSize="8"
isBold="false"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false">
<box></box>
</style>
<style
name="detail_small"
isDefault="false"
fontName="Arial"
fontSize="8"
isBold="false"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false"
/>
<style
name="detail_large"
isDefault="false"
fontName="Arial"
fontSize= "10"
isBold="false"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica"
isPdfEmbedded="false"
/>
<style
name="columnLabel"
isDefault="false"
forecolor="#000000"
fontName="Arial"
fontSize="10"
isBold="true"
isItalic="false"
isUnderline="false"
isStrikeThrough="false"
pdfFontName="Helvetica-Bold"
isPdfEmbedded="false"
/>
<queryString><![CDATA[SELECT K.NAME,
CASE
WHEN KL.STATUS IN ( 1, 2 ) THEN 'SUCCESS'
WHEN KL.STATUS IN ( 3.4 ) THEN 'FAILURE'
ELSE 'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN,
M.NAME
FROM KBOT_LOG KL
INNER JOIN KBOT K
ON K.ID = KL.KBOT_ID
AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M
ON M.ID = KL.MACHINE_ID
WHERE K.NAME = 'CoWriter 6.0 [Silent]'
ORDER BY 1,
2,
3,
4]]></queryString>
<field name="NAME" class="java.lang.String"/>
<field name="STATUS" class="java.lang.String"/>
<field name="SCRIPT_RUN" class="java.sql.Timestamp"/>
<field name="NAME" class="java.lang.String"/>
<background>
<band height="0" >
</band>
</background>
<title>
<band height="100" >
<line direction="TopDown">
<reportElement
x="0"
y="98"
width="781"
height="0"
forecolor="#808080"
key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line direction="TopDown">
<reportElement
x="0"
y="3"
width="781"
height="0"
forecolor="#808080"
key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<staticText>
<reportElement
style="ReportHeader"
x="99"
y="5"
width="465"
height="27"
key="staticText-1"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[CoWriter 6 [Silent]]]></text>
</staticText>
<textField isStretchWithOverflow="false" pattern="'Generated :' EEEEE dd MMMMM yyyy 'at' HH:mm:ss" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
style="detail_large"
x="99"
y="38"
width="465"
height="20"
key="staticText-1"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
</textField>
<staticText>
<reportElement
style="detail_large"
x="99"
y="58"
width="465"
height="20"
key="staticText-4"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[Category :]]></text>
</staticText>
<staticText>
<reportElement
style="detail_large"
x="3"
y="78"
width="777"
height="20"
key="staticText-5"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[Description:]]></text>
</staticText>
<image evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="3"
y="5"
width="85"
height="30"
key="image-1"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<graphicElement stretchType="NoStretch"/>
<imageExpression class="java.lang.String"><![CDATA["/kbox/kboxwww//adminui/reports/KBOX_logo.jpg"]]></imageExpression>
</image>
</band>
</title>
<pageHeader>
<band height="0" >
</band>
</pageHeader>
<columnHeader>
<band height="20" >
<frame>
<reportElement
style="ColumnHeaderPanel"
mode="Opaque"
x="0"
y="0"
width="782"
height="20"
key="frame-2"/>
<line direction="BottomUp">
<reportElement
x="0"
y="0"
width="782"
height="0"
forecolor="#000000"
key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="0.25" lineStyle="Solid"/>
</graphicElement>
</line>
<line direction="BottomUp">
<reportElement
x="0"
y="19"
width="782"
height="0"
forecolor="#000000"
key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="0.25" lineStyle="Solid"/>
</graphicElement>
</line>
<staticText>
<reportElement
style="ColumnHeaderFooter"
x="0"
y="0"
width="50"
height="15"
key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding ="Cp1250" />
</textElement>
<text><![CDATA[#]]></text>
</staticText> <staticText>
<reportElement
style="ColumnHeaderFooter"
x="50"
y="0"
width="183"
height="15"
key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding ="Cp1250" />
</textElement>
<text><![CDATA[NAME]]></text>
</staticText> <staticText>
<reportElement
style="ColumnHeaderFooter"
x="233"
y="0"
width="183"
height="15"
key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding ="Cp1250" />
</textElement>
<text><![CDATA[STATUS]]></text>
</staticText> <staticText>
<reportElement
style="ColumnHeaderFooter"
x="416"
y="0"
width="183"
height="15"
key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding ="Cp1250" />
</textElement>
<text><![CDATA[SCRIPT_RUN]]></text>
</staticText> <staticText>
<reportElement
style="ColumnHeaderFooter"
x="599"
y="0"
width="183"
height="15"
key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding ="Cp1250" />
</textElement>
<text><![CDATA[NAME]]></text>
</staticText>
</frame>
</band>
</columnHeader>
<detail>
<band height="17" >
<line direction="TopDown">
<reportElement
x="0"
y="0"
width="782"
height="0"
forecolor="#808080"
backcolor="#FFFFFF"
key="line"/>
<graphicElement stretchType="NoStretch"/>
</line>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
style="Detail"
x="0"
y="0"
width="50"
height="15"
key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[String.valueOf($V{REPORT_COUNT})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
style="Detail"
x="50"
y="0"
width="183"
height="15"
key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[$F{NAME}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
style="Detail"
x="233"
y="0"
width="183"
height="15"
key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[$F{STATUS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
style="Detail"
x="416"
y="0"
width="183"
height="15"
key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[($F{SCRIPT_RUN} == null ? "":(new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")).format($F{SCRIPT_RUN}))]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
style="Detail"
x="599"
y="0"
width="183"
height="15"
key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[$F{NAME}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="0" >
</band>
</columnFooter>
<pageFooter>
<band height="27" >
<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="572"
y="6"
width="170"
height="19"
key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Right">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="746"
y="6"
width="36"
height="19"
key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<line direction="TopDown">
<reportElement
x="0"
y="3"
width="782"
height="0"
forecolor="#000000"
key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="1"
y="6"
width="209"
height="19"
key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="0" >
</band>
</summary>
</jasperReport>
Posted by:
mramsdell
12 years ago
try this
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="landscape"
columnCount="1"
printOrder="Vertical"
orientation="Portrait"
pageWidth="842"
pageHeight="595"
columnWidth="782"
columnSpacing="0"
leftMargin="30"
rightMargin="30"
topMargin="20"
bottomMargin="20"
whenNoDataType="AllSectionsNoDetail"
isTitleNewPage="false"
isSummaryNewPage="false">
<property name="ireport.scriptlethandling" value="0"/>
<property name="ireport.encoding" value="UTF-8"/>
<import value="java.util.*"/>
<import value="net.sf.jasperreports.engine.*"/>
<import value="net.sf.jasperreports.engine.data.*"/>
<style name="GroupLabel" mode="Transparent" fontName="Arial" fontSize="10" forecolor="#FFFFFF" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false"/>
<style name="GroupHeader" mode="Transparent" fontName="Arial" fontSize="10" forecolor="#FFFFFF" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false">
<box leftPadding="3"/>
</style>
<style name="GroupFooter" mode="Transparent" fontName="Arial" fontSize="10" forecolor="#e5e5e5" backcolor="#e5e5e5" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false">
<box leftPadding="3"/>
</style>
<style name="ColumnHeaderFooter" mode="Transparent" isDefault="false" fontName="Arial" fontSize="10" forecolor="#FFFFFF" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false">
<box leftPadding="3"/>
</style>
<style name="ColumnHeaderPanel" isDefault="false" mode="Opaque" forecolor="#FFFFFF" backcolor="#006699" fill="Solid" fontName="Arial" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false"/>
<style name="GroupHeaderPanel" isDefault="false" mode="Opaque" forecolor="#FFFFFF" backcolor="#999999" fill="Solid" fontName="Arial" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false"/>
<style name="ReportHeader" mode="Transparent" forecolor="#000000" isDefault="false" fontName="Arial" fontSize="16" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false">
<box/>
</style>
<style name="Detail" mode="Transparent" forecolor="#000000" isDefault="false" fontName="Arial" fontSize="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false">
<box/>
</style>
<style name="detail_small" isDefault="false" fontName="Arial" fontSize="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false"/>
<style name="detail_large" isDefault="false" fontName="Arial" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="false"/>
<style name="columnLabel" isDefault="false" forecolor="#000000" fontName="Arial" fontSize="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" isPdfEmbedded="false"/>
<queryString><![CDATA[SELECT K.NAME,
CASE
WHEN KL.STATUS IN ( 1, 2 ) THEN 'SUCCESS'
WHEN KL.STATUS IN ( 3.4 ) THEN 'FAILURE'
ELSE 'UNKNOWN'
END AS STATUS,
START_TIME AS SCRIPT_RUN,
M.NAME
FROM KBOT_LOG KL
INNER JOIN KBOT K
ON K.ID = KL.KBOT_ID
AND K.TYPE != 'SYSTEM'
INNER JOIN MACHINE M
ON M.ID = KL.MACHINE_ID
WHERE K.NAME = 'CoWriter 6.0 '
ORDER BY 1,
2,
3,
4]]></queryString>
<field name="NAME" class="java.lang.String"/>
<field name="STATUS" class="java.lang.String"/>
<field name="SCRIPT_RUN" class="java.sql.Timestamp"/>
<field name="MACHINE_NAME" class="java.lang.String"/>
<background>
<band height="0">
</band>
</background>
<title>
<band height="100">
<line direction="TopDown">
<reportElement x="0" y="98" width="781" height="0" forecolor="#808080" key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line direction="TopDown">
<reportElement x="0" y="3" width="781" height="0" forecolor="#808080" key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<staticText>
<reportElement style="ReportHeader" x="99" y="5" width="465" height="27" key="staticText-1"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[123 test]]></text>
</staticText>
<textField isStretchWithOverflow="false" pattern="'Generated :' EEEEE dd MMMMM yyyy 'at' HH:mm:ss" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement style="detail_large" x="99" y="38" width="465" height="20" key="staticText-1"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="detail_large" x="99" y="58" width="465" height="20" key="staticText-4"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[Category :]]></text>
</staticText>
<staticText>
<reportElement style="detail_large" x="3" y="78" width="777" height="20" key="staticText-5"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[Description:]]></text>
</staticText>
<image evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement x="3" y="5" width="85" height="30" key="image-1"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<graphicElement stretchType="NoStretch"/>
<imageExpression class="java.lang.String"><![CDATA["/kbox/kboxwww//adminui/reports/KBOX_logo.jpg"]]></imageExpression>
</image>
</band>
</title>
<pageHeader>
<band height="0">
</band>
</pageHeader>
<columnHeader>
<band height="20">
<frame>
<reportElement style="ColumnHeaderPanel" mode="Opaque" x="0" y="0" width="782" height="20" key="frame-2"/>
<line direction="BottomUp">
<reportElement x="0" y="0" width="782" height="0" forecolor="#000000" key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="0.25" lineStyle="Solid"/>
</graphicElement>
</line>
<line direction="BottomUp">
<reportElement x="0" y="19" width="782" height="0" forecolor="#000000" key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="0.25" lineStyle="Solid"/>
</graphicElement>
</line>
<staticText>
<reportElement style="ColumnHeaderFooter" x="0" y="0" width="50" height="15" key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[#]]></text>
</staticText> <staticText>
<reportElement style="ColumnHeaderFooter" x="50" y="0" width="156" height="15" key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[NAME]]></text>
</staticText> <staticText>
<reportElement style="ColumnHeaderFooter" x="206" y="0" width="156" height="15" key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[STATUS]]></text>
</staticText> <staticText>
<reportElement style="ColumnHeaderFooter" x="362" y="0" width="156" height="15" key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[SCRIPT_RUN]]></text>
</staticText> <staticText>
<reportElement style="ColumnHeaderFooter" x="518" y="0" width="156" height="15" key="staticText "/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[MACHINE_NAME]]></text>
</staticText>
</frame>
</band>
</columnHeader>
<detail>
<band height="17">
<line direction="TopDown">
<reportElement x="0" y="0" width="782" height="0" forecolor="#808080" backcolor="#FFFFFF" key="line"/>
<graphicElement stretchType="NoStretch"/>
</line>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement style="Detail" x="0" y="0" width="50" height="15" key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[String.valueOf($V{REPORT_COUNT})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement style="Detail" x="50" y="0" width="156" height="15" key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[$F{NAME}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement style="Detail" x="206" y="0" width="156" height="15" key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[$F{STATUS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement style="Detail" x="362" y="0" width="156" height="15" key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[($F{SCRIPT_RUN} == null ? "":(new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")).format($F{SCRIPT_RUN}))]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement style="Detail" x="518" y="0" width="156" height="15" key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression class="java.lang.String"><![CDATA[$F{MACHINE_NAME}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="0">
</band>
</columnFooter>
<pageFooter>
<band height="27">
<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement x="572" y="6" width="170" height="19" key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Right">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement x="746" y="6" width="36" height="19" key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<line direction="TopDown">
<reportElement x="0" y="3" width="782" height="0" forecolor="#000000" key="line"/>
<graphicElement stretchType="NoStretch">
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self">
<reportElement x="1" y="6" width="209" height="19" key="textField"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="0">
</band>
</summary>
</jasperReport>
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.