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

reportdev

Members
  • Posts

    413
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by reportdev

  1. As per the Support, an enhancement request has been logged and is still waiting http://community.jaspersoft.com/wiki/issue-involving-tibco-jasperreports-pdf-output-fillable-format
  2. align all the fields in grid lines of your report layout. it will eliminate the merging of cells in xlsx. sample jrxml <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2017-02-27T09:34:54 --><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="conditional" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="db6c00f0-db29-49f5-8e70-22e8b82b00ea"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select 2017as year,700000as figure1,390000 as figure2,98000 as figure3,50000 as figure4 from dual unionselect 2018as year,250000as figure1,85000 as figure2,70000 as figure3,160000 as figure4 from dual unionselect 2019as year,21149.43as figure1,9252.87 as figure2,0 as figure3,0 as figure4 from dual]]> </queryString> <field name="YEAR" class="java.math.BigDecimal"/> <field name="FIGURE1" class="java.math.BigDecimal"/> <field name="FIGURE2" class="java.math.BigDecimal"/> <field name="FIGURE3" class="java.math.BigDecimal"/> <field name="FIGURE4" class="java.math.BigDecimal"/> <variable name="Sum" class="java.math.BigDecimal" incrementType="Column" calculation="Sum"> <variableExpression><![CDATA[$F{FIGURE1}.add($F{FIGURE2}).add($F{FIGURE3}).add($F{FIGURE4})]]></variableExpression> </variable> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="20" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="80" height="20" uuid="46953091-95ae-45a0-824a-c6349193ff95"/> <text><![CDATA[YEAR]]></text> </staticText> <staticText> <reportElement x="180" y="0" width="100" height="20" uuid="c6dc70ef-2c28-4d64-9df8-c42816c01f31"/> <text><![CDATA[FIGURE1]]></text> </staticText> <staticText> <reportElement x="280" y="0" width="100" height="20" uuid="e9585303-7fe5-4507-a3c7-644f754e679f"/> <text><![CDATA[FIGURE2]]></text> </staticText> <staticText> <reportElement x="380" y="0" width="100" height="20" uuid="8239325a-b107-4454-81ed-e39d9514bb26"/> <text><![CDATA[FIGURE3]]></text> </staticText> <staticText> <reportElement x="480" y="0" width="100" height="20" uuid="e514dc9e-41e3-4d5b-945f-8075a4e15f55"/> <text><![CDATA[FIGURE4]]></text> </staticText> <staticText> <reportElement x="80" y="0" width="100" height="20" uuid="4f52ebc9-80bc-4db2-8dc5-50e49bb2ade5"/> <text><![CDATA[sum]]></text> </staticText> </band> </columnHeader> <detail> <band height="20" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="80" height="20" uuid="d50a5931-7d89-4975-a885-18f1449986e1"/> <textFieldExpression><![CDATA[$F{YEAR}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="180" y="0" width="100" height="20" uuid="3767ad7c-044a-48b2-85fe-884d4a721517"/> <textFieldExpression><![CDATA[$F{FIGURE1}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="280" y="0" width="100" height="20" uuid="949b7196-f620-4a45-a0a2-ebfc97016ae3"/> <textFieldExpression><![CDATA[$F{FIGURE2}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="380" y="0" width="100" height="20" uuid="bd1411b1-1326-43bb-a42c-ec8f91a30170"/> <textFieldExpression><![CDATA[$F{FIGURE3}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="480" y="0" width="100" height="20" uuid="304de87a-d1d9-4c65-82b1-20d3a5f54a06"/> <textFieldExpression><![CDATA[$F{FIGURE4}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="80" y="0" width="100" height="20" uuid="e8c5c029-32dd-47c6-8f6a-d623645f3f4c"/> <textFieldExpression><![CDATA[$V{Sum}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  3. try using http://localhost:8080/jasperserver/rest_v2/reports/reports/simple_blue/main_jrxml.pdf i believe, after rest_v2, reports specifies the type of resource that you are trying to access.
  4. @siva.abburi did you try logging into the postgres database and querying the audit tables? I would suggest querying the audit and monitoring tables instead of using the built in reports on server.
  5. can you post your jrxml here and also try reset the workspace properties especially the Default PDF Encodng
  6. if you would like to use style tags, you should be using html field instead of a text field. Note: jasperserver does not support html fields anymore. try to use html field with expression "<b>DISCLAIMER:</b> This report is confidential. <b> Do not share. </b> If found, please destroy." <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2017-02-24T10:57:29 --><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="pdffont" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8a331d21-2608-405b-a765-e33dc06ccc20"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select * from dual]]> </queryString> <field name="DUMMY" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="30" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="100" height="30" uuid="24ad440f-d8b5-4cc1-9b93-7fe5a84fd623"/> <text><![CDATA[DUMMY]]></text> </staticText> </band> </columnHeader> <detail> <band height="30" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="05d3e22a-71c0-4b73-9fee-d6b4db7cbb83"/> <textFieldExpression><![CDATA[$F{DUMMY}]]></textFieldExpression> </textField> </band> </detail> <pageFooter> <band height="31" splitType="Stretch"> <componentElement> <reportElement x="0" y="0" width="555" height="31" uuid="01041075-7c49-4fbf-b169-39e8befc78ee"/> <hc:html xmlns:hc="http://jasperreports.sourceforge.net/htmlcomponent" xsi:schemaLocation="http://jasperreports.sourceforge.net/htmlcomponent http://jasperreports.sourceforge.net/xsd/htmlcomponent.xsd" scaleType="RetainShape" horizontalAlign="Left" verticalAlign="Middle"> <hc:htmlContentExpression><![CDATA["<b>DISCLAIMER:</b> This report is confidential. <b> Do not share. </b> If found, please destroy."]]></hc:htmlContentExpression> </hc:html> </componentElement> </band> </pageFooter></jasperReport>[/code]
  7. try checking if the datasource is set on the report and also ensure that the detail band has some text field and is getting the data from datasource. Tente verificar se a fonte de dados está definida no relatório e também garantir que a faixa de detalhe tem algum campo de texto e está recebendo os dados de datasource
  8. check this path - C:Jaspersoftjasperreports-server-cp-6.3.0apache-tomcatwebappsjasperserverWEB-INFjs.config.properties this js.config.properties file should have two values audit.records.enabled=falsemonitoring.records.enabled=falsechange these values to true
  9. There is No $X{EQUALS} condition in Jasper. as per documentation http://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v60/using-parameters-queries use $X{EQUAL, column_name, param_name} or $X{IN, column_name, param_name}
  10. Below jrxml would provide you with the selected timezone current date/time based on a parameter. some timezone id's that can be passed as a parameter value : Pacific/ApiaPacific/MidwayPacific/NiuePacific/Pago_PagoPacific/SamoaUS/SamoaAmerica/AdakAmerica/AtkaEtc/GMT+10[/code]try using your field values with the selected timezone expressions and see if it works <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2017-02-23T13:22:58 --><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="timezone" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="544f695c-dad6-4924-a4f2-7555ee097887"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <parameter name="TimezoneSelector" class="java.lang.String"> <defaultValueExpression><![CDATA["America/Anchorage"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[select to_date('12/30/2015 3:39:26 PM', 'MM/dd/yyyy hh:mi:ss AM') my_datefrom dual]]> </queryString> <field name="MY_DATE" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <detail> <band height="180" splitType="Stretch"> <textField pattern="MM/dd/yyyy"> <reportElement x="380" y="30" width="100" height="30" uuid="aebe7a58-592b-4482-826b-702a4702cb8f"/> <textFieldExpression><![CDATA[DATE(java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone($P{TimezoneSelector})).get(java.util.Calendar.YEAR), java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone($P{TimezoneSelector})).get(java.util.Calendar.MONTH)+1, java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone($P{TimezoneSelector})).get(java.util.Calendar.DATE))]]></textFieldExpression> </textField> <textField> <reportElement x="180" y="30" width="100" height="30" uuid="a1157501-937d-4cd0-a703-90983ebf160b"/> <textFieldExpression><![CDATA[$P{TimezoneSelector}]]></textFieldExpression> </textField> <textField> <reportElement x="580" y="30" width="100" height="30" uuid="316bd2af-778f-43e8-b2db-0c323915ba92"/> <textFieldExpression><![CDATA[TIME(java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone($P{TimezoneSelector})).get(java.util.Calendar.HOUR_OF_DAY),java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone($P{TimezoneSelector})).get(java.util.Calendar.MINUTE),java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone($P{TimezoneSelector})).get(java.util.Calendar.SECOND),"hh:mm:ss a")]]></textFieldExpression> </textField> <staticText> <reportElement x="180" y="0" width="100" height="30" uuid="6a3b238f-ed56-4728-96dd-677e57bcc89a"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[selected timezone]]></text> </staticText> <staticText> <reportElement x="580" y="0" width="100" height="30" uuid="8b6a9891-fe7b-4653-9ca7-925805f19cb5"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[selected timezone time]]></text> </staticText> <staticText> <reportElement x="380" y="0" width="100" height="30" uuid="6166e4ff-8c8e-402b-b8ac-75c1e15cf50d"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[selected timezone date]]></text> </staticText> <textField pattern="MM/dd/yyyy"> <reportElement x="380" y="150" width="100" height="30" uuid="6ce3bfaf-184e-4926-aa9e-05633e0dfa46"/> <textFieldExpression><![CDATA[new Date()]]></textFieldExpression> </textField> <textField> <reportElement x="180" y="150" width="100" height="30" uuid="d3f1919c-b04e-4c41-ac3b-290dd97f48aa"/> <textFieldExpression><![CDATA[$P{REPORT_TIME_ZONE}.getID()]]></textFieldExpression> </textField> <textField pattern="hh:mm:ss a"> <reportElement x="580" y="150" width="100" height="30" uuid="2a3158a1-dc35-422b-8837-fd3c07935e74"/> <textFieldExpression><![CDATA[new Date()]]></textFieldExpression> </textField> <staticText> <reportElement x="180" y="120" width="100" height="30" uuid="1606f8e7-3447-4543-9a16-a2d8dd58c08c"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[current timezone]]></text> </staticText> <staticText> <reportElement x="580" y="120" width="100" height="30" uuid="43cffca4-84b7-4cd7-800b-47dac4240739"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[current timezone time]]></text> </staticText> <staticText> <reportElement x="380" y="120" width="100" height="30" uuid="3e8cca4a-2476-47a2-a2bf-443a338bc249"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[current timezone date]]></text> </staticText> </band> </detail></jasperReport>[/code]
  11. you can use joeuser, password is joeuser or jasperadmin, password is jasperadmin
  12. the jasperserver uses postgres database and this database can be accessed from the pgadmin tool. Add a connection in pgadmin to your postgres database. check this site http://community.jaspersoft.com/documentation/jasperreports-server-install-guide/v561/selecting-postgresql-configuration In the jasperserver database, execute below query in pgadmin and it will return the required resultset. select jr.id, jr.name, jr.label, jr.creation_date,ja.user_id, ju.username From jiresource jr, jiaccessevent ja, jiuser ju where jr.id = ja.resource_id and ja.user_id = ju.id and (jr.name like '%.pdf' or jr.name like '%.xls%')
  13. check this post. http://community.jaspersoft.com/questions/969281/jasperserver-and-sql-query-using-clause
  14. i dont know if below would solve your purpose or not, but string reversing can be used and print right to left characters. new StringBuilder($F{FIELD}).reverse().toString()
  15. i believe you are missing the groups, page breaks and sorting on the data. check the below jrxml. and from my understanding, the summary prints only once at the end of the report, instead i would use group footers to print your summary <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2017-02-21T15:06:33 --><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="compare" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryNewPage="true" uuid="358d8010-5f1c-4bdb-a0fe-41ff59b7857b"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select 'record - one' as ID, 1 as sortid from dual unionselect 'record - two' as ID,2 as sortid from dual unionselect 'record - three' as ID, 3 as sortid from dual]]> </queryString> <field name="ID" class="java.lang.String"/> <field name="SORTID" class="java.math.BigDecimal"/> <sortField name="SORTID"/> <group name="ID" isStartNewPage="true"> <groupExpression><![CDATA[$F{ID}]]></groupExpression> <groupHeader> <band height="19"> <textField evaluationTime="Group" evaluationGroup="ID"> <reportElement mode="Opaque" x="0" y="-1" width="555" height="20" backcolor="#FF0400" uuid="dd3519d0-3691-4792-a104-d5902f53fcf7"/> <textElement> <font size="11"/> </textElement> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> </band> </groupHeader> <groupFooter> <band height="30"> <staticText> <reportElement x="0" y="0" width="80" height="30" uuid="eb436f93-694b-416c-af29-2038635e4343"/> <textElement> <font size="11"/> </textElement> <text><![CDATA[summary for]]></text> </staticText> <textField evaluationTime="Group" evaluationGroup="ID"> <reportElement x="80" y="0" width="100" height="30" uuid="fe080c9f-d962-463c-9af0-1c70689173ec"/> <textElement> <font size="11"/> </textElement> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> </band> </groupFooter> </group> <background> <band splitType="Stretch"/> </background> <pageHeader> <band height="30"> <staticText> <reportElement x="0" y="0" width="100" height="30" uuid="158b7a4f-15f2-4a17-94bf-c0b844ac8129"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[Page Header]]></text> </staticText> </band> </pageHeader> <detail> <band height="30" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="80" height="30" uuid="aa8e499d-65c4-463b-b817-765205c50e46"/> <textElement> <font size="11"/> </textElement> <text><![CDATA[Details 1 for]]></text> </staticText> <textField evaluationTime="Group" evaluationGroup="ID"> <reportElement x="80" y="0" width="100" height="30" uuid="89db5070-6cee-428a-89df-4b8a776ba628"/> <textElement> <font size="11"/> </textElement> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> </band> <band height="31"> <staticText> <reportElement x="0" y="0" width="80" height="30" uuid="dfbe021b-74f6-4622-864a-0803930bb93e"/> <textElement> <font size="11"/> </textElement> <text><![CDATA[Details 2 for]]></text> </staticText> <break> <reportElement x="0" y="-1" width="100" height="1" uuid="79b82227-6c43-4daa-b129-87a5ba59525d"/> </break> <break> <reportElement x="0" y="30" width="99" height="1" uuid="04ced895-e6fb-4b3c-9cfd-1575ba657b02"/> </break> <textField evaluationTime="Group" evaluationGroup="ID"> <reportElement x="80" y="0" width="100" height="30" uuid="a1d1b304-5c2d-46fb-b450-936abbae4369"/> <textElement> <font size="11"/> </textElement> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> </band> <band height="31"> <staticText> <reportElement x="0" y="0" width="80" height="30" uuid="de9a9121-439b-4b9a-a2a1-b87dbe45b9a2"/> <textElement> <font size="11"/> </textElement> <text><![CDATA[Details 3 for]]></text> </staticText> <break> <reportElement x="0" y="30" width="99" height="1" uuid="66ab9694-f834-4298-8245-a6e45f5c908a"/> </break> <textField evaluationTime="Group" evaluationGroup="ID"> <reportElement x="80" y="0" width="100" height="30" uuid="079821a8-a5ff-4234-97d6-ad3b8b3a8cfc"/> <textElement> <font size="11"/> </textElement> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  16. you can use conditional styles in jasper studio. sample below <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2017-02-21T14:05:01 --><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="compare" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="358d8010-5f1c-4bdb-a0fe-41ff59b7857b"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <style name="Style1"> <conditionalStyle> <conditionExpression><![CDATA[$F{ID}.compareTo($F{ID2}) > 0]]></conditionExpression> <style mode="Opaque" forecolor="#FF0400" backcolor="#FFFF00"/> </conditionalStyle> </style> <queryString> <![CDATA[select 1 as ID, 2 as ID2 from dual unionselect 3 as ID, 2 as ID2 from dual]]> </queryString> <field name="ID" class="java.math.BigDecimal"/> <field name="ID2" class="java.math.BigDecimal"/> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="21" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="100" height="20" uuid="d633e915-b545-499f-9b6b-fbca0a6f2ecd"/> <text><![CDATA[A]]></text> </staticText> <staticText> <reportElement x="100" y="0" width="100" height="20" uuid="da3670cb-f9c3-4066-9fdb-4c3d3387f598"/> <text><![CDATA[b]]></text> </staticText> <staticText> <reportElement x="200" y="1" width="100" height="20" uuid="1aea2acb-377c-4334-a9fe-c253ea1931fd"/> <text><![CDATA[Compare]]></text> </staticText> </band> </columnHeader> <detail> <band height="20" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="100" height="20" uuid="429e73e7-4afb-4ac7-81c6-d650fe9d5bc6"> <property name="com.jaspersoft.studio.unit.y" value="pixel"/> </reportElement> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="0" width="100" height="20" uuid="3af6bf71-971d-4af5-8895-6d9e79224fa9"/> <textFieldExpression><![CDATA[$F{ID2}]]></textFieldExpression> </textField> <textField> <reportElement style="Style1" x="200" y="0" width="100" height="20" uuid="775435e9-0181-4c8d-bd89-9d0028722abd"/> <textFieldExpression><![CDATA["Test"]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  17. 1. try replacing the field with DATEFORMAT(new Date(), "MM/dd/yyyy" ) 2. Enter the Source code of jrxml by clicking on the Source tab for the report 3. you should find some property name, value pairs like below <property name="ireport.jasperserver.user" value="reportdev"/> 4. At the end of these properties copy below property and save/publish <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>
  18. Check this jrxml <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2017-02-17T09:35:18 --><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="one" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="304d0e96-d129-4a55-a8e4-7b68fd1b78e3"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select 1 as ID from dual unionselect 2 as ID from dual unionselect 3 as ID from dual unionselect 4 as ID from dual]]> </queryString> <field name="ID" class="java.math.BigDecimal"/> <group name="IDBlank" isStartNewPage="true"> <groupExpression><![CDATA[$F{ID}]]></groupExpression> </group> <group name="ID" isStartNewPage="true"> <groupExpression><![CDATA[$F{ID}]]></groupExpression> <groupFooter> <band height="24"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/> <break> <reportElement x="0" y="0" width="98" height="1" uuid="e6e936da-15d6-4bd6-99bf-308012f2b6f0"/> </break> </band> </groupFooter> </group> <background> <band splitType="Stretch"/> </background> <detail> <band height="30" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="9d65f728-f0e5-4aa8-95b4-391386f6422d"/> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  19. On the Sum variable, the Increment type should be Column and the Reset Type should be Report Check this report jrxml <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2017-02-16T15:02:46 --><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="conditional" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="db6c00f0-db29-49f5-8e70-22e8b82b00ea"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select 2017as year,700000as figure1,390000 as figure2,98000 as figure3,50000 as figure4 from dual unionselect 2018as year,250000as figure1,85000 as figure2,70000 as figure3,160000 as figure4 from dual unionselect 2019as year,21149.43as figure1,9252.87 as figure2,0 as figure3,0 as figure4 from dual]]> </queryString> <field name="YEAR" class="java.math.BigDecimal"/> <field name="FIGURE1" class="java.math.BigDecimal"/> <field name="FIGURE2" class="java.math.BigDecimal"/> <field name="FIGURE3" class="java.math.BigDecimal"/> <field name="FIGURE4" class="java.math.BigDecimal"/> <variable name="Sum" class="java.math.BigDecimal" incrementType="Column" calculation="Sum"> <variableExpression><![CDATA[$F{FIGURE1}.add($F{FIGURE2}).add($F{FIGURE3}).add($F{FIGURE4})]]></variableExpression> </variable> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="20" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="80" height="20" uuid="46953091-95ae-45a0-824a-c6349193ff95"/> <text><![CDATA[YEAR]]></text> </staticText> <staticText> <reportElement x="180" y="0" width="100" height="20" uuid="c6dc70ef-2c28-4d64-9df8-c42816c01f31"/> <text><![CDATA[FIGURE1]]></text> </staticText> <staticText> <reportElement x="280" y="0" width="100" height="20" uuid="e9585303-7fe5-4507-a3c7-644f754e679f"/> <text><![CDATA[FIGURE2]]></text> </staticText> <staticText> <reportElement x="380" y="0" width="100" height="20" uuid="8239325a-b107-4454-81ed-e39d9514bb26"/> <text><![CDATA[FIGURE3]]></text> </staticText> <staticText> <reportElement x="480" y="0" width="100" height="20" uuid="e514dc9e-41e3-4d5b-945f-8075a4e15f55"/> <text><![CDATA[FIGURE4]]></text> </staticText> <staticText> <reportElement x="80" y="0" width="100" height="20" uuid="4f52ebc9-80bc-4db2-8dc5-50e49bb2ade5"/> <text><![CDATA[sum]]></text> </staticText> </band> </columnHeader> <detail> <band height="20" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="80" height="20" uuid="d50a5931-7d89-4975-a885-18f1449986e1"/> <textFieldExpression><![CDATA[$F{YEAR}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="180" y="0" width="100" height="20" uuid="3767ad7c-044a-48b2-85fe-884d4a721517"/> <textFieldExpression><![CDATA[$F{FIGURE1}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="280" y="0" width="100" height="20" uuid="949b7196-f620-4a45-a0a2-ebfc97016ae3"/> <textFieldExpression><![CDATA[$F{FIGURE2}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="380" y="0" width="100" height="20" uuid="bd1411b1-1326-43bb-a42c-ec8f91a30170"/> <textFieldExpression><![CDATA[$F{FIGURE3}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="480" y="0" width="100" height="20" uuid="304de87a-d1d9-4c65-82b1-20d3a5f54a06"/> <textFieldExpression><![CDATA[$F{FIGURE4}]]></textFieldExpression> </textField> <textField pattern="¤#,##0.##;¤-#,##0.00"> <reportElement x="80" y="0" width="100" height="20" uuid="e8c5c029-32dd-47c6-8f6a-d623645f3f4c"/> <textFieldExpression><![CDATA[$V{Sum}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  20. If you have access to the postgres database running behind the jasper server, this issue can be cleared up i believe. The jasper repository database has a table called as jireportunit from which you should be able to query the reportunit and delete the dependency. It might have been caused by copying the report unit multiple times and changing its attributes.
  21. Check this post http://community.jaspersoft.com/questions/824118/limit-records-page
  22. Try using the above posted jrxml and display the Dynamic1 variable with the evaluation time of Report. It is displaying the value after it has been fixed. "==" has been used for checking equality of objects, which will not work in some of the cases. I have changed it to ".equals" method which is specifically used for checking equality of objects
  23. <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2017-02-15T14:59:49 --><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="variable" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="68d0c2e9-bd2c-476f-a817-ed72542eac63"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> <parameter name="PARAM_DYNAMIC1" class="java.lang.String"> <defaultValueExpression><![CDATA["IT_PM"]]></defaultValueExpression> </parameter> <parameter name="PARAM_DYNAMIC2" class="java.lang.String"> <defaultValueExpression><![CDATA["IT_PM"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[select 'ITPM' as ITPM,'ITPMOLEAD' as ITPMOLEAD,'BUSPMOLEAD' as BUSPMOLEAD,'ITSPONSOR' as ITSPONSOR from dual]]> </queryString> <field name="ITPM" class="java.lang.String"/> <field name="ITPMOLEAD" class="java.lang.String"/> <field name="BUSPMOLEAD" class="java.lang.String"/> <field name="ITSPONSOR" class="java.lang.String"/> <variable name="Dynamic1" class="java.lang.String" resetType="Master"> <variableExpression><![CDATA[($P{PARAM_DYNAMIC1}.equals("IT_PMO") ? "IT PMO Lead" :($P{PARAM_DYNAMIC1}.equals("BUS_PMO") ? "Business PMO Lead" :($P{PARAM_DYNAMIC1}.equals("IT_PM") ? "IT Project Manager" :($P{PARAM_DYNAMIC1}.equals("IT_SPONSOR")? "IT Sponsor" : ""))))]]></variableExpression> </variable> <variable name="Dynamic2" class="java.lang.String" resetType="Master"> <variableExpression><![CDATA[($P{PARAM_DYNAMIC1}.equals("IT_PMO") ? "IT PMO Lead" :($P{PARAM_DYNAMIC1}.equals("BUS_PMO") ? "Business PMO Lead" :($P{PARAM_DYNAMIC1}.equals("IT_PM") ? "IT Project Manager" :($P{PARAM_DYNAMIC1}.equals("IT_SPONSOR")? "IT Sponsor" : ""))))]]></variableExpression> </variable> <variable name="Dynamic1_Val" class="java.lang.String"> <variableExpression><![CDATA[($V{Dynamic1} == "IT PMO Lead" ? ($F{ITPMOLEAD} == null ? "Nothing to display" : $F{ITPMOLEAD} ):($V{Dynamic1} == "Business PMO Lead" ? ($F{BUSPMOLEAD} == null ? "Nothing to display" : $F{BUSPMOLEAD} ):($V{Dynamic1} == "IT Project Manager" ? ($F{ITPM} == null ? "Nothing to display" : $F{ITPM} ):($V{Dynamic1} == "IT Sponsor" ? ($F{ITSPONSOR} == null ? "Nothing to display" : $F{ITSPONSOR} ) : ""))))]]></variableExpression> </variable> <variable name="Dynamic2_Val" class="java.lang.String"> <variableExpression><![CDATA[($V{Dynamic2} == "IT PMO Lead" ? ($F{ITPMOLEAD} == null ? "Nothing to display" : $F{ITPMOLEAD} ):($V{Dynamic2} == "Business PMO Lead" ? ($F{BUSPMOLEAD} == null ? "Nothing to display" : $F{BUSPMOLEAD} ):($V{Dynamic2} == "IT Project Manager" ? ($F{ITPM} == null ? "Nothing to display" : $F{ITPM} ):($V{Dynamic2} == "IT Sponsor" ? ($F{ITSPONSOR} == null ? "Nothing to display" : $F{ITSPONSOR} ) : ""))))]]></variableExpression> </variable> <background> <band splitType="Stretch"/> </background> <title> <band height="30" splitType="Stretch"> <textField evaluationTime="Report"> <reportElement x="0" y="0" width="100" height="30" uuid="7ef8763d-4294-4a5f-b615-7013a4b061d6"/> <textFieldExpression><![CDATA[$V{Dynamic1_Val}]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="180" y="0" width="100" height="30" uuid="1ca2c1d6-b941-418a-bfd3-0c34e36751fd"/> <textFieldExpression><![CDATA[$V{Dynamic2_Val}]]></textFieldExpression> </textField> </band> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="61" splitType="Stretch"/> </columnHeader> <detail> <band height="30" splitType="Stretch"/> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="56" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport>[/code]I believe that your conditional expressions are not correct. check the above jrxml PARAM_DYNAMIC1 parameter is returning "IT_PM" Dynamic1 variable is decoding "IT_PM" and returning "IT Project Manager" Dynamic1_Val variable is again trying to decode the value of Dynamic1 variable as "IT_PM" , which is not correct. It should be looking for "IT Project Manager".
  24. I can think of two possible places to check. a rectangle element would have been inserted with the conditional style behind the textfieldsall the textfields would have been applied with the conditional stylesample code below <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --><!-- 2017-01-27T12:54:46 --><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_3" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="05e26242-e3d0-4d1d-be44-111aa4ea6c1e"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <style name="Style1"> <conditionalStyle> <conditionExpression><![CDATA[$F{NAME}.equals("three") ? true : false]]></conditionExpression> <style mode="Opaque" backcolor="#FF0400"/> </conditionalStyle> </style> <queryString> <![CDATA[select 1 as id, 'one' as name from dual unionselect 2 as id, 'two' as name from dual unionselect 3 as id, 'three' as name from dual unionselect 4 as id, 'four' as name from dual unionselect 5 as id, 'five' as name from dual unionselect 6 as id, 'six' as name from dual]]> </queryString> <field name="ID" class="java.math.BigDecimal"/> <field name="NAME" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="30" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="80" height="30" uuid="07f0751f-5ca6-4399-bbe1-db596394f33c"/> <text><![CDATA[iD]]></text> </staticText> <staticText> <reportElement x="80" y="0" width="100" height="30" uuid="33ec7d70-67e1-4b18-b873-5feb713fba0e"/> <text><![CDATA[NAME]]></text> </staticText> </band> </columnHeader> <detail> <band height="30" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="80" height="30" uuid="ed6d0f1f-c0bf-430b-b0ed-6ac1f98c7a9d"/> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> <textField> <reportElement x="80" y="0" width="100" height="30" uuid="7cb02ed3-ac3e-44d7-a61c-c50723f18ea1"/> <textFieldExpression><![CDATA[$F{NAME}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
×
×
  • Create New...