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

bigalex

Members
  • Posts

    75
  • 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 bigalex

  1. Below is the list of properties that can accommodate the report export to excel format.

    Also, check to make sure all fields on the report are aligned vertically and horizontally and remove any spaces in between including page mergings.

    <property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns"value="true"/>

    <property name="net.sf.jasperreports.export.xls.ignore.cell.border" value="false"/>

    <property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.1" value="pageHeader"/>
    <property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.2" value="pageFooter"/>
    <property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.3" value="lastPageFooter"/>
    <property name="net.sf.jasperreports.export.xlsx.ignore.cell.background" value="true"/>
    <property name="net.sf.jasperreports.export.xlsx.white.page.background" value="false"/>
    <property name="net.sf.jasperreports.export.xlsx.ignore.graphics" value="true"/>
    <property name="net.sf.jasperreports.export.xlsx.detect.cell.type=true"/>
    <property name="net.sf.jasperreports.export.xlsx.remove.empty.space.between.rows=true"/>
    <property name="net.sf.jasperreports.export.xlsx.remove.empty.space.between.columns=true"/>
    <property name="net.sf.jasperreports.export.xlsx.collapse.row.span" value="true"/>
    <property name="net.sf.jasperreports.export.xlsx.ignore.page.margins=true"/>
    <property name="net.sf.jasperreports.export.xlsx.one.page.per.sheet=true"/>
    <property name="net.sf.jasperreports.export.xlsx.wrap.text" value="true"/>
    <property name="net.sf.jasperreports.export.xls.column.width.ratio" value="1.10f"/>
    <property name="net.sf.jasperreports.export.xls.auto.fit.column" value="true"/>

    <property name="net.sf.jasperreports.export.xls.freeze.row" value="2"/>

    <property name="net.sf.jasperreports.exports.xls.font.size.fix.enabled" value="false"/>

    <property name="net.sf.jasperreports.export.xls.sheet.names.all" value="Data/Footnotes"/>

  2. Would you be able to provide the full TEXT error ?

    Also,check to make sure the sas.Servis and Pocet are not Zero; otherwise, it will be an endless loop in your formula (100/Pocet*sas.Servis). Use NULLIF function - NULLIF(expression1, expression2) to avoid division by zero.

  3. Would you be able to provide the error you see in  Jasper? I am just guessing here that Jasper doesn’t like the query line with .object. ( ae.object.objectId) , the error may provide more info on why the query doesn’t work in Jasper.

  4. Use Print When Expression. Please see the example below.

    Assuming that VAR1 in Field 1 and VAR2 in Field 2, then add expression to Print When Expression: $F{VAR1}!=null   will display  field 1 when it is not empty. The same for field 2.

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.16.0.final using JasperReports Library version 6.16.0-48579d909b7943b64690c65c71e07e0b80981928  -->
    <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="2fields" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8d2657b1-69a0-45dc-95f3-d1f76163e412">
        <parameter name="Field1" class="java.lang.String"/>
        <parameter name="Field2" class="java.lang.String"/>
        <queryString>
            <![CDATA[]]>
        </queryString>
        <background>
            <band splitType="Stretch"/>
        </background>
        <pageHeader>
            <band height="81" splitType="Stretch">
                <textField evaluationTime="Report">
                    <reportElement mode="Opaque" x="10" y="8" width="460" height="30" forecolor="#FFFFFF" backcolor="#FA100C" uuid="e7344090-e068-42b3-a60e-1199c653d487">
                        <printWhenExpression><![CDATA[$P{Field1}!=null]]></printWhenExpression>
                    </reportElement>
                </textField>
                <textField evaluationTime="Report">
                    <reportElement mode="Opaque" x="10" y="40" width="460" height="30" forecolor="#050505" backcolor="#07FAE6" uuid="c81b9400-78e0-4840-964a-ae69d67644c3">
                        <printWhenExpression><![CDATA[$P{Field2}!=null]]></printWhenExpression>
                    </reportElement>
                </textField>
            </band>
        </pageHeader>
    </jasperReport>

     

  5. The only way I know of to have a connection to multiple data sources is to use connection parameter(s).

    Suggestion is:

    • Use one of the subreports as the main report or at least use the same data source

    (you can select the data source and then place on the main report query  something like- Select 1 from dual )

    • Create Parameter (i.e., $P{Subreport2_conn}) on the main report  to use for connection to the data source in Subreport2:
      • Class: java.sql.Connection
      • Is For Promting: Uncheck
      • Default value Expression: java.sql.DriverManager.getConnection("jdbc:oracle:thin:@YourServerIP:YourServerPort/yourdatabase","UserID","Password")

    Not sure what your drive is; in my case, it is   jdbc:oracle:thin

    • Set the Connection Expression in Subreport2 to $P{Subreport2_conn}

    I was using the same approach to connect five different data sources from one report.

    I hope this helps.

  6. https://yourjasperserver.com/jasperserver/rest/resources/reports?type=reportUnit&recursive=1

    You may need to copy and paste it to the notepad++ to remove unwanted tags. Of course, this is not an ideal solution, but you will get  list of all reports from the JasperServer.

  7. Try to publish the report  again by click on the Publish icon in the Jasper Studio and then point the parameter to the  correct resource reference.

    Tip: Create an Archive folder on the server (with only access by admin role), then copy the folder with the reports you want to update and paste it into Archive. This way, you will have a previous copy of the report for tracking and recovery purposes.

  8. In order to use "Remove Line When Blank" in Detail band,  the whole line must be empty. In your case, there is a Static text filed on the first line. You may try to put all variables in one field and use "n"  between the records, however it will required to validate the variable and verify  if it is empty or not.

  9. Try to change the Reset type for  $V{signedInfo}  , I am not sure if it is appropriate for your report

    Please see the example below where variable Reset Type is set to None insted of Report

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.16.0.final using JasperReports Library version 6.16.0-48579d909b7943b64690c65c71e07e0b80981928  -->
    <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="Blank_A4_2" pageWidth="595" pageHeight="400" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b736cbc8-581d-4f10-985f-78b77784ea4c">
        <style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
            <box>
                <pen lineWidth="0.5" lineColor="#000000"/>
                <topPen lineWidth="0.5" lineColor="#000000"/>
                <leftPen lineWidth="0.5" lineColor="#000000"/>
                <bottomPen lineWidth="0.5" lineColor="#000000"/>
                <rightPen lineWidth="0.5" lineColor="#000000"/>
            </box>
        </style>
        <style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
            <box>
                <pen lineWidth="0.5" lineColor="#000000"/>
                <topPen lineWidth="0.5" lineColor="#000000"/>
                <leftPen lineWidth="0.5" lineColor="#000000"/>
                <bottomPen lineWidth="0.5" lineColor="#000000"/>
                <rightPen lineWidth="0.5" lineColor="#000000"/>
            </box>
        </style>
        <style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
            <box>
                <pen lineWidth="0.5" lineColor="#000000"/>
                <topPen lineWidth="0.5" lineColor="#000000"/>
                <leftPen lineWidth="0.5" lineColor="#000000"/>
                <bottomPen lineWidth="0.5" lineColor="#000000"/>
                <rightPen lineWidth="0.5" lineColor="#000000"/>
            </box>
        </style>
        <parameter name="signedInfo" class="java.lang.String">
            <defaultValueExpression><![CDATA["I have tried every cobination of positionType and stretchType and evaluation time. Nothing has worked. I even made sure the print order is vertical. I used jasper version 6.11 and even upgraded to 6.17. No success. Whenever the dynamic text from the variable is longer than the text field and takes up a second line, it only shows the first line."]]></defaultValueExpression>
        </parameter>
        <queryString>
            <![CDATA[]]>
        </queryString>
        <variable name="signedInfo" class="java.lang.String" resetType="None">
            <variableExpression><![CDATA[$P{signedInfo}]]></variableExpression>
        </variable>
        <variable name="signedInfo_1" class="java.lang.String">
            <variableExpression><![CDATA[$P{signedInfo}]]></variableExpression>
        </variable>
        <pageHeader>
            <band height="43" splitType="Prevent">
                <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
                <textField textAdjust="StretchHeight" evaluationTime="Auto">
                    <reportElement positionType="Float" stretchType="ContainerHeight" x="110" y="0" width="120" height="16" uuid="939ca8a9-5c57-445a-8992-54babc9c7302">
                        <property name="com.jaspersoft.studio.unit.height" value="px"/>
                        <property name="com.jaspersoft.studio.unit.width" value="px"/>
                    </reportElement>
                    <textFieldExpression><![CDATA[$V{signedInfo}]]></textFieldExpression>
                </textField>
                <textField textAdjust="StretchHeight" evaluationTime="Auto">
                    <reportElement positionType="Float" stretchType="ContainerHeight" x="360" y="0" width="190" height="16" uuid="1548eef7-f54a-4b53-945f-29552fcb6bee">
                        <property name="com.jaspersoft.studio.unit.height" value="px"/>
                        <property name="com.jaspersoft.studio.unit.width" value="px"/>
                    </reportElement>
                    <textFieldExpression><![CDATA[$V{signedInfo_1}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement x="0" y="0" width="100" height="16" uuid="fb7b2e39-2bdf-4ddc-ab71-2bae725aa85b"/>
                    <text><![CDATA[Reset Type =None]]></text>
                </staticText>
                <staticText>
                    <reportElement x="250" y="0" width="100" height="16" uuid="288d8362-f38c-4d8b-b023-046cbc9883ac"/>
                    <text><![CDATA[Reset Type =Report]]></text>
                </staticText>
            </band>
        </pageHeader>
    </jasperReport>
     

  10.  

    Variables ANO and ANO_ACT cannot be null  and must be evaluated. 

    Expression:  $P{ANO}!=null? ($P{ANO}.equals($P{ANO_ACT}!=null ? (Integer.parseInt($P{ANO_ACT})-1+""): "ANO_ACT is Null")?$V{CAN}:new BigDecimal("0")): "ANO is empty"

    See example below:

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.16.0.final using JasperReports Library version 6.16.0-48579d909b7943b64690c65c71e07e0b80981928  -->
    <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="String to Integer" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c5f3f90c-4936-41e8-a034-b7a768ac9060">
        <parameter name="ANO" class="java.lang.String"/>
        <parameter name="ANO_ACT" class="java.lang.String"/>
        <queryString>
            <![CDATA[]]>
        </queryString>
        <variable name="CAN" class="java.lang.String">
            <initialValueExpression><![CDATA["CAN"]]></initialValueExpression>
        </variable>
        <background>
            <band splitType="Stretch"/>
        </background>
        <pageHeader>
            <band height="35" splitType="Stretch">
                <textField>
                    <reportElement x="80" y="5" width="430" height="30" uuid="d99f10a3-6103-4987-ab25-33932aa27d2c"/>
                    <textFieldExpression><![CDATA[$P{ANO}!=null? ($P{ANO}.equals($P{ANO_ACT}!=null ? (Integer.parseInt($P{ANO_ACT})-1+""): "ANO_ACT} is Null")?$V{CAN}:new BigDecimal("0")): "ANO is empty"
    ]]></textFieldExpression>
                </textField>
            </band>
        </pageHeader>
        <summary>
            <band height="42" splitType="Stretch"/>
        </summary>
    </jasperReport>
     

     

  11. Change the text field “Markup” to HTML 

    Expression:  "This is my "+ " " +"<"+"<"+"Report"+">"+">"

    or "This is my  "+"<<Report>>"

     

    See Example below:

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.16.0.final using JasperReports Library version 6.16.0-48579d909b7943b64690c65c71e07e0b80981928  -->
    <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="Blank_A4_5" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="63aa31c7-2c3f-4f3e-aabd-cb707c3743db">
        <queryString>
            <![CDATA[]]>
        </queryString>
        <background>
            <band splitType="Stretch"/>
        </background>
        <pageHeader>
            <band height="107" splitType="Stretch">
                <textField>
                    <reportElement x="120" y="10" width="310" height="30" uuid="ffee2868-50ed-4d72-82a4-b4c5d6d35885"/>
                    <box>
                        <pen lineWidth="0.25"/>
                    </box>
                    <textElement markup="html"/>
                    <textFieldExpression><![CDATA["This is my "+ " " +"<"+"<"+"Report"+">"+">"]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement x="20" y="10" width="100" height="30" uuid="b06091aa-b4a7-40e2-b557-1d6b6899b85d"/>
                    <box>
                        <pen lineWidth="0.25"/>
                    </box>
                    <text><![CDATA

    ]></text>
                </staticText>
                <staticText>
                    <reportElement x="20" y="50" width="100" height="30" uuid="f975511e-1abd-4952-8286-37f21e8d9876"/>
                    <box>
                        <pen lineWidth="0.25"/>
                    </box>
                    <text><![CDATA[Default]]></text>
                </staticText>
                <textField>
                    <reportElement x="120" y="50" width="310" height="30" uuid="ed073ad1-4d38-427f-855b-710a8fa8125b"/>
                    <box>
                        <pen lineWidth="0.25"/>
                    </box>
                    <textFieldExpression><![CDATA["This is my "+ " "+"<<Report>>"]]></textFieldExpression>
                </textField>
            </band>
        </pageHeader>
    </jasperReport>
×
×
  • Create New...