Jump to content
We've recently updated our Privacy Statement, available here ×

kolaitis

Members
  • Posts

    35
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by kolaitis

  1. Something like that in iReport query :

     

    (SELECT dbo.yourProcedure_Function (dataBaseFile.field, $P{iReport_Param1}))

    as Name1

     

    (select dbo.yourProcedure_Function ($P{iReport_Param1}, $P{iReport_Param2},

    $P{iReport_Param3}, $P{iReport_Param4})) as Name2

     

    AND

    (SELECT dbo.yourProcedure_Function(dataBaseFile.field, $P{iReport_Param1},

    $P{iReport_Param2})) = $P{iReport_Param3}

     

    AND

    dbo.yourProcedure_Function(dataBaseFile.field) = $P{iReport_Param4}

     

    Good Luck....

     

  2. My suggestion is to use subreport IN subreport.

    1) Main report , on detail Band the first subreport

    2) In first subreport , place your second subreport

    Don not forget to pass parameter SUBREPORT_DIR for the second subreport

    I hope that my solution is suitable for you.

    Good Luck.

  3. Suggestion :

    1) Create only one Group.

        Place on, your first subreport.

        Total, in your subreport.

    2) Expand summary Band.

         Edit / Report Properties / More / Summary on a new Page  (true)

         Place on, your second subreport.

         Total, in your subreport.

    - If you wish a grandTotal, assign  Subreport Return values parameters

      adding them in a variable on your main report.

    Regards......

  4. Dear Dick ..................

     

    <?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="TEST"
             columnCount="1"
             printOrder="Vertical"
             orientation="Portrait"
             pageWidth="595"
             pageHeight="842"
             columnWidth="535"
             columnSpacing="0"
             leftMargin="30"
             rightMargin="30"
             topMargin="20"
             bottomMargin="20"
             whenNoDataType="NoPages"
             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.*" />

        <queryString><![CDATA[select distinct top 10  PositionTime
    from
    myFile
    where  myFileCode = '75'
    ]]></queryString>

        <field name="PositionTime" class="java.lang.String"/>

        <variable name="INITIAL" class="java.math.BigDecimal" resetType="Report" calculation="Nothing">
            <variableExpression><![CDATA[$V{SECONDS}]]></variableExpression>
            <initialValueExpression><![CDATA[new BigDecimal(0)]]></initialValueExpression>
        </variable>
        <variable name="MINUTES" class="java.math.BigDecimal" resetType="Report" calculation="Nothing">
            <variableExpression><![CDATA[new BigDecimal($F{PositionTime}.substring( 0, 2 ))]]></variableExpression>
        </variable>
        <variable name="SECONDS" class="java.math.BigDecimal" resetType="Report" calculation="Nothing">
            <variableExpression><![CDATA[new BigDecimal($F{PositionTime}.substring( 3, 5 ))]]></variableExpression>
        </variable>
        <variable name="DIFFERENCE_MINUTES" class="java.math.BigDecimal" resetType="Report" calculation="Nothing">
            <variableExpression><![CDATA[$V{MINUTES}.doubleValue()>0 ? $V{SECONDS}.add(new BigDecimal(60).subtract($V{INITIAL})):null]]></variableExpression>
        </variable>
        <variable name="DIFFERENCE_SECONDS" class="java.math.BigDecimal" resetType="Report" calculation="Nothing">
            <variableExpression><![CDATA[($V{SECONDS}.subtract( $V{INITIAL} )).abs()]]></variableExpression>
        </variable>
            <background>
                <band height="0"  isSplitAllowed="true" >
                </band>
            </background>
            <title>
                <band height="0"  isSplitAllowed="true" >
                </band>
            </title>
            <pageHeader>
                <band height="0"  isSplitAllowed="true" >
                </band>
            </pageHeader>
            <columnHeader>
                <band height="0"  isSplitAllowed="true" >
                </band>
            </columnHeader>
            <detail>
                <band height="36"  isSplitAllowed="false" >
                    <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                        <reportElement
                            x="11"
                            y="10"
                            width="61"
                            height="18"
                            key="textField-1">
                                <printWhenExpression><![CDATA[new Boolean($V{MINUTES}.doubleValue()==0)]]></printWhenExpression>
                            </reportElement>
                        <box></box>
                        <textElement isStyledText="true">
                            <font/>
                        </textElement>
                    <textFieldExpression   class="java.lang.String"><![CDATA[$V{DIFFERENCE_SECONDS}!=null && $V{DIFFERENCE_SECONDS}.doubleValue()>5 ?
    "<style forecolor=red'>" + $F{PositionTime} + "</style>" :
    "<style forecolor='black'>" + $F{PositionTime} + "</style&gt]]></textFieldExpression>
                    </textField>
                    <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                        <reportElement
                            x="11"
                            y="10"
                            width="61"
                            height="18"
                            key="textField-2">
                                <printWhenExpression><![CDATA[new Boolean($V{MINUTES}.doubleValue()!=0)]]></printWhenExpression>
                            </reportElement>
                        <box></box>
                        <textElement isStyledText="true">
                            <font/>
                        </textElement>
                    <textFieldExpression   class="java.lang.String"><![CDATA[$V{DIFFERENCE_MINUTES}!=null && $V{DIFFERENCE_MINUTES}.doubleValue()>5 ?
    "<style forecolor=red'>" + $F{PositionTime} + "</style> " :
    "<style forecolor='black'>" + $F{PositionTime} + "</style&gt]]></textFieldExpression>
                    </textField>
                </band>
            </detail>
            <columnFooter>
                <band height="0"  isSplitAllowed="true" >
                </band>
            </columnFooter>
            <pageFooter>
                <band height="0"  isSplitAllowed="true" >
                </band>
            </pageFooter>
            <summary>
                <band height="0"  isSplitAllowed="true" >
                </band>
            </summary>
    </jasperReport>
     

     

    Good Luck.

  5. Correction section 2

    a)$V{DIFFERENCE_SECONDS}!=null && $V{DIFFERENCE_SECONDS}.doubleValue()>5 ?
    "<style forecolor='red'>" + $F{PositionTime} + "</style>" " :
    "<style forecolor='black'>" + $F{PositionTime} + "</style> "

    b)$V{DIFFERENCE_MINUTES}!=null && $V{DIFFERENCE_MINUTES}.doubleValue()>5 ?
    "<style forecolor='red'>" + $F{PositionTime} + "</style> " :
    "<style forecolor='black'>" + $F{PositionTime} + "</style> "



    Post Edited by kolaitis at 05/04/2011 13:20
  6. Suggestion :

    1) Create Variables

    ClassType Expression

    INITIAL BigDecimal $V{SECONDS} InitValue : new BigDecimal(0)

    MINUTES -"- new BigDecimal(minutesOfYourFieldName(2pos))

    SECONDS -"- new BigDecimal(secondsOfYourFieldName(2pos))

    DIFFERENCE_SECONDS -"- ($V{SECONDS}.subtract( $V{INITIAL} )).abs()

    DIFFERENCE_MINUTES -"- $V{MINUTES}.doubleValue()>0 ?

    $V{SECONDS}.add(

    new BigDecimal(60).subtract($V{INITIAL})):null

     

    2) Create two text fields in Detail Band on top of each other :

    a) Expression

    $V{DIFFERENCE_SECONDS}!=null &&

    $V{DIFFERENCE_SECONDS}.doubleValue()>5 ?

    " " :

    " "

    PrintWhenExpression

    new Boolean($V{MINUTES}.doubleValue()==0)

     

    b) $V{DIFFERENCE_MINUTES}!=null &&

    $V{DIFFERENCE_MINUTES}.doubleValue()>5 ?

    " " :

    " "

    PrintWhenExpression

    new Boolean($V{MINUTES}.doubleValue()!=0)

     

    Good Luck.

  7. Suggestion :

    On tab View  Groups,  be carefull for Group priority.

    group1

    group2

    group3

    Inspect your sum variables that has : Reset Type:  Group   ,  appropriate GroupName.

    Good Luck.

  8. Suggestion :

    Create variable i.e: D1 , VariableClassType : java.lang.String , VariableExpression : {yourDoubleValueField}.toString()

    Create text Field in your Detail Band with expression :

    $V{D1}.endsWith( ".0" ) ? $V{D1}.replace( ".0", "    " ) :
    new DecimalFormat("#,##0.##;- #,##0.##").format( {yourDoubleValueField} )

     

    Good Luck.

     

  9. In your calling form..

     

    Map reportParameters = new HashMap();

    reportParameters.put("DATE", super.getDate("selected_Date"));

     

    In iReport, assign parameter : DATE , class Type : java.util.Date

     

    In iReport Query :

    Where yourDataBaseFile.DateField = $P{DATE}

     

  10. Suggestions :

    A) Is your Opening Balance a return value from a subreport ?

         If so your receiving variable i.e $V{BALANCE} to prevent null must have expression :

         new BigDecimal(0).add($V{BALANCE})

    B) In Detail Band , under column "Balance" are you using a variable i.e. $V{DETAIL_BALANCE}

         to calculate the progressive result ?

        If so variable expression : $V{BALANCE}.add( yourDebit.subtract( yourCredit ) )

    Good Luck.

  11. Another approch.

    Create a Group  on one of your database field. (Start OnNew Page = true) 

    On group footer create Subreport  . Aling to left most position.

    printWhenExpression: new Boolean(($V{REPORT_COUNT}.intValue() % 2) == 1)      odd

    Copy the created subreport on desire right position,  on top of the other subreport.

    printWhenExpression: new Boolean(($V{REPORT_COUNT}.intValue() % 2) == 0)      even

    Good Luck.

×
×
  • Create New...