Jump to content

biztux

Members
  • Posts

    3
  • Joined

  • Last visited

biztux's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare

Recent Badges

0

Reputation

  1. We experienced the following problem: Our Servers are configured in The timezone Australia/Melbourne (+10:00/+11:00 DST). Whenever we used java.text.SimpleDateFormat("yyyy-MM-dd HH:mm").format($P{StartDate}) in reports the output was an Additional 10 or 11 (Dependant upon DST or not) hours in front of what it should display. Solution: At the top of the jrxml file where parameters are created we used the following: <code> <parameter name="StartDate" class="java.sql.Timestamp"> <parameterDescription><![CDATA[Report Start Date]]></parameterDescription> </parameter> <parameter name="EndDate" class="java.sql.Timestamp"> <parameterDescription><![CDATA[Report End Date]]></parameterDescription> </parameter> <parameter name="DateFormatter" class="java.text.DateFormat"> <defaultValueExpression><![CDATA[$P{REPORT_FORMAT_FACTORY}.createDateFormat("yyyy-MM-dd HH:mm", $P{REPORT_LOCALE}, java.util.TimeZone.getTimeZone("GMT"))]]></defaultValueExpression> </parameter> </code> In the Page Footer section where we wanted to display the Start and End dates for the Report: <code> <textField> <reportElement x="180" y="7" width="377" height="13"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA["Date range between: "+$P{DateFormatter}.format($P{StartDate})+" and "+$P{DateFormatter}.format($P{EndDate})]]></textFieldExpression> </textField> </code> The results are that we now have correct values which are only dependent upon the User's Time Zone settings... Code:<!-- PARAMETER DECLARATIONS --> <parameter name="StartDate" class="java.sql.Timestamp"> <parameterDescription><![CDATA[Report Start Date]]></parameterDescription> </parameter> <parameter name="EndDate" class="java.sql.Timestamp"> <parameterDescription><![CDATA[Report End Date]]></parameterDescription> </parameter> <parameter name="DateFormatter" class="java.text.DateFormat"> <defaultValueExpression><![CDATA[$P{REPORT_FORMAT_FACTORY}.createDateFormat("yyyy-MM-dd HH:mm", $P{REPORT_LOCALE}, java.util.TimeZone.getTimeZone("GMT"))]]></defaultValueExpression> </parameter><!-- REPORT PAGE FOOTER SECTION --> <textField> <reportElement x="180" y="7" width="377" height="13"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA["Date range between: "+$P{DateFormatter}.format($P{StartDate})+" and "+$P{DateFormatter}.format($P{EndDate})]]></textFieldExpression> </textField>
  2. Hi, Whilst I am new to iReports, I have been working with reporting tools for many years and I have issues with Jasper iReports V3.7 handling of Input Parameters and Patterns... My problem is that I want to choose 2 dates each formatted as "yyyy-MM-dd HH:mm:ss.SSS" being 4 digit year, 2digit month, 2 digit day, 2 digit Hour, 2 digit minute, 2 digit seconds and 3 digit micro-seconds. This is a mandatory requirement for our Systems Engineering guys to get this sort of fine grained reporting from our Database. I have not had any success in getting this to work. The xml snippets below is from one of our reports... <parameter name="StartDate" class="java.util.Date" isForPrompting="false" /> <parameter name="EndDate" class="java.util.Date" isForPrompting="false" /> <queryString> <![CDATA[sELECT FROM_UNIXTIME(WF_Timestamp) Req_Date_Time, SUBSTR(Request_URL,1,LOCATE("?",Request_URL)-1) Search_URL, REPLACE( SUBSTR( SUBSTR( Request_URL, LOCATE( "?",Request_URL ) +1 ),1),"+"," ") Search_Terms, User_Name, Source_IP_Address Client_IP FROM REPORTING.WEBFILTER_REPORTING WHERE (LOCATE('google',lower(Request_URL))>0 OR LOCATE('yahoo',lower(Request_URL))>0) AND LOCATE('http://localhost/cgi-bin/utils/proxy/',Request_URL)=0 AND Flags < 64 AND (FROM_UNIXTIME(WF_Timestamp) BETWEEN $P{StartDate} AND $P{EndDate})]]> </queryString> Note: The WF_Timestamp above is a UNIX TIMESTAMP including Time to nano-seconds. and <pageFooter> <band height="27"> <textField> <reportElement mode="Opaque" x="0" y="4" width="734" height="13" backcolor="#E6E6E6"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement mode="Opaque" x="734" y="4" width="52" height="13" backcolor="#E6E6E6"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField pattern="yyyy-MM-dd HH:mm:ss"> <reportElement x="0" y="4" width="120" height="13"/> <textElement/> <textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> <textField> <reportElement x="130" y="4" width="118" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA["Date range between: "]]></textFieldExpression> </textField> <textField> <reportElement x="248" y="4" width="135" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format($P{StartDate})]]></textFieldExpression> </textField> <textField> <reportElement x="386" y="4" width="35" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[" and "]]></textFieldExpression> </textField> <textField> <reportElement x="424" y="4" width="139" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format($P{EndDate})]]></textFieldExpression> </textField> </band> </pageFooter> Please advise how I can set up an Input Control which will present itself as a Date, Time , Microtime formatted as "yyyy-MM-dd HH:mm:ss.SSS" I am not a Java Programmer, but can understand the use of the various classes ie: java.sql.Timestamp, java.util.Date and the methods they provide etc... Please avoid the US Convention of "MM-dd-yyyy" as this is just plain confusing for our European and Australasian Clients. Code:<?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="SearchEngineRequests" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="786" leftMargin="28" rightMargin="28" topMargin="28" bottomMargin="28"> <parameter name="StartDate" class="java.util.Date" isForPrompting="false" /> <parameter name="EndDate" class="java.util.Date" isForPrompting="false" /> <queryString> <![CDATA[sELECT FROM_UNIXTIME(WF_Timestamp) Req_Date_Time, SUBSTR(Request_URL,1,LOCATE("?",Request_URL)-1) Search_URL, REPLACE( SUBSTR( SUBSTR( Request_URL, LOCATE( "?",Request_URL ) +1 ),1),"+"," ") Search_Terms, User_Name, Source_IP_Address Client_IPFROM REPORTING.WEBFILTER_REPORTINGWHERE (LOCATE('google',lower(Request_URL))>0 OR LOCATE('yahoo',lower(Request_URL))>0)AND LOCATE('http://localhost/cgi-bin/utils/proxy/',Request_URL)=0AND Flags < 64AND (FROM_UNIXTIME(WF_Timestamp) BETWEEN $P{StartDate} AND $P{EndDate})]]> </queryString> <field name="Req_Date_Time" class="java.sql.Timestamp"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="Search_URL" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="Search_Terms" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="User_Name" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="Client_IP" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <background> <band/> </background> <pageHeader> <band height="103"> <line> <reportElement x="0" y="102" width="786" height="1" forecolor="#000000"/> </line> <staticText> <reportElement x="383" y="34" width="403" height="35" forecolor="#0099CC"/> <textElement textAlignment="Right"> <font size="24" isBold="true"/> </textElement> <text><![CDATA[search Engine Keywords Report]]></text> </staticText> <image> <reportElement x="0" y="0" width="277" height="91"/> <imageExpression class="java.lang.String"><![CDATA["repo:EditureWebLogo.gif"]]></imageExpression> </image> </band> </pageHeader> <columnHeader> <band height="28"> <line> <reportElement x="0" y="26" width="786" height="1" forecolor="#666666"/> </line> <staticText> <reportElement x="0" y="5" width="97" height="20"/> <textElement markup="none"> <font fontName="SansSerif" size="10" isBold="true"/> </textElement> <text><![CDATA[Request Date]]></text> </staticText> <staticText> <reportElement x="370" y="5" width="239" height="20"/> <textElement markup="none"> <font fontName="SansSerif" size="10" isBold="true"/> </textElement> <text><![CDATA[Request URL]]></text> </staticText> <staticText> <reportElement x="617" y="5" width="169" height="20"/> <textElement markup="none"> <font fontName="SansSerif" size="10" isBold="true"/> </textElement> <text><![CDATA[search Terms]]></text> </staticText> <staticText> <reportElement x="97" y="5" width="156" height="20"/> <textElement markup="none"> <font fontName="SansSerif" size="10" isBold="true"/> </textElement> <text><![CDATA[user Name]]></text> </staticText> <staticText> <reportElement x="266" y="5" width="103" height="20"/> <textElement markup="none"> <font fontName="SansSerif" size="10" isBold="true"/> </textElement> <text><![CDATA[Client IP]]></text> </staticText> </band> </columnHeader> <detail> <band height="28"> <textField> <reportElement x="0" y="4" width="97" height="20"/> <textElement> <font fontName="SansSerif"/> </textElement> <textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{Req_Date_Time}]]></textFieldExpression> </textField> <textField> <reportElement x="97" y="4" width="156" height="20"/> <textElement> <font fontName="SansSerif"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{User_Name}]]></textFieldExpression> </textField> <textField> <reportElement x="266" y="4" width="103" height="20"/> <textElement> <font fontName="SansSerif"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{Client_IP}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="370" y="4" width="239" height="20"/> <textElement> <font fontName="SansSerif"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{Search_URL}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="617" y="4" width="169" height="20"/> <textElement> <font fontName="SansSerif"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{Search_Terms}]]></textFieldExpression> </textField> <line> <reportElement positionType="FixRelativeToBottom" x="0" y="26" width="786" height="1"/> </line> </band> </detail> <columnFooter> <band/> </columnFooter> <pageFooter> <band height="27"> <textField> <reportElement mode="Opaque" x="0" y="4" width="734" height="13" backcolor="#E6E6E6"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement mode="Opaque" x="734" y="4" width="52" height="13" backcolor="#E6E6E6"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField pattern="yyyy-MM-dd HH:mm:ss"> <reportElement x="0" y="4" width="120" height="13"/> <textElement/> <textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> <textField> <reportElement x="130" y="4" width="118" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA["Date range between: "]]></textFieldExpression> </textField> <textField> <reportElement x="248" y="4" width="135" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{StartDate})]]></textFieldExpression> </textField> <textField> <reportElement x="386" y="4" width="35" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[" and "]]></textFieldExpression> </textField> <textField> <reportElement x="424" y="4" width="139" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{EndDate})]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band/> </summary></jasperReport>
  3. Once upon a time there were command line switches which allowed systems integrators / testers to install using commands which cut-out or bypassed some of the questions in the installer (or at least set defaults: root@mybox.mydomain.com # ./jasperserver-ce-3.7.0-RC-linux-installer.bin --mode text --mysql_installtype existing --mysql_binary_directory /usr/bin/ --mysql_port 3306 --mysql_root_user root Can you please list all of the command line options for version 3.7 and is it possible to configure the mail server parameters as used in: /opt/jasperserver-ce-3.7.0/scripts/mysql/js.quartz.properties via the same mechanism so that we can perform scripted installations of jasperserver? Post Edited by biztux at 01/27/2010 02:47
×
×
  • Create New...