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

Downloads

Everything posted by reportdev

  1. try compiling it using Jaspersoft Studio and see if it compiles.
  2. When the report opens in the browser, the path is shown on the browser. You can just copy that and paste it into different browser. At that time, jasper server will reauthenticate.
  3. If you are using Oracle / SQL Server. try writing a procedure which will update the records in the database. This is done using plsql datasource on jasper. https://community.jaspersoft.com/questions/1076991/generate-unique-document-number Above post has a jrxml in it... I believe you are basically trying to do the same thing.
  4. In the jasper studio, Parameters can be dragged up and down.
  5. create a jrxml with excel datasource. create a grouping based on the excel datasource city. Inside the group header/footer. create a table element which would use the sql query and fetch the records from database. pass the city group value into the table element which will filter as per the group value.
  6. Try these js-import options https://community.jaspersoft.com/documentation/jasperreports-server-administration-guide/v550/import-and-export-through-command-line https://community.jaspersoft.com/documentation/jasperreports-server-administration-guide/v550/import-and-export-through-web-ui
  7. Try these Config references. I believe it should fix your issue. http://jasperreports.sourceforge.net/sample.reference/xlsfeatures/index.html#formatPattern <textField pattern="EEE, MMM d, yyyy"> <reportElement style="Sans_Bold" mode="Opaque" x="0" y="30" width="515" height="30" forecolor="#000000"> <property name="net.sf.jasperreports.export.xls.pattern" value="ddd, mmm d, yyyy"/> </reportElement> ... </textField> In this case the EEE, MMM d, yyyy pattern, completely valid in Java but generating unreadable content for Excel, is replaced with the equivalent ddd, mmm d, yyyy pattern when exporting report to Excel.
  8. Are you not using Jasper Studio to edit the reports ? Using jasper studio would allow you to visually see the subreport layout and modify it
  9. I would do it this way, if using Oracle. Its all about writing sql queries and manipulating data. In this query, I'm trying to find if the SQL column has any values in it or not and based on that display another column (count(hidden) over()) called as cnt. On the report, I'm hiding or displaying the label based on this cnt value. <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.4.2.final using JasperReports Library version 6.4.1 --><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="hiddenColumns" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f58fcefb-99f3-4b9b-82f8-ea7e2def8065"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select ID, value, hidden, count(hidden) over() cnt from (select 1 as ID, '1value' as value, null as hidden from dual union all select 2 as ID, '2value' as value, 1 as hidden from dual union all select 3 as ID, '3value' as value, null as hidden from dual union all select 4 as ID, '4value' as value, null as hidden from dual)]]> </queryString> <field name="ID" class="java.math.BigDecimal"/> <field name="VALUE" class="java.lang.String"/> <field name="HIDDEN" class="java.math.BigDecimal"/> <field name="CNT" class="java.math.BigDecimal"/> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="20" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="80" height="20" uuid="805c2f8d-cdca-4595-8218-8570b40401d2"/> <text><![CDATA[iD]]></text> </staticText> <staticText> <reportElement x="80" y="0" width="100" height="20" uuid="39b36d26-e2ec-4ea7-aa88-893707be4378"/> <text><![CDATA[VALUE]]></text> </staticText> <textField> <reportElement x="180" y="0" width="185" height="20" uuid="8a5676a9-0105-42b9-95bf-c6eb0cca04c7"/> <textFieldExpression><![CDATA[$F{CNT}.intValue() >= 0 ? "HIDDEN FIELD" : ""]]></textFieldExpression> </textField> </band> </columnHeader> <detail> <band height="20" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="80" height="20" uuid="38185a27-39e0-4d5f-b8ed-9883b9f4cc8b"> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> </reportElement> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> <textField> <reportElement x="80" y="0" width="100" height="20" uuid="1b58f194-7829-4f66-8585-737366362d24"/> <textFieldExpression><![CDATA[$F{VALUE}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement x="180" y="0" width="185" height="20" uuid="f9dbd4e9-1c65-4145-9e25-06ba9aeabde4"/> <textFieldExpression><![CDATA[$F{HIDDEN}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]In order to hide the column entirely, try changing the 1 as hidden to null as hidden on the 2nd row of the SQL.
  10. I have used a text box with 1367 characters and could not find this problem in JasperStudio. Change your editor to Jasper studio... itext is not supported <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.4.2.final using JasperReports Library version 6.4.1 --><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="characterLimit" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="7d75621f-6b29-4c3d-a38c-ed8278203a40"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc,' as text from dual]]> </queryString> <field name="TEXT" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <title> <band height="33" splitType="Stretch"/> </title> <detail> <band height="20" splitType="Stretch"> <textField isStretchWithOverflow="true"> <reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="555" height="20" uuid="bcde966c-a656-404e-888d-5b1557cf532d"/> <textFieldExpression><![CDATA[$F{TEXT}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  11. Try doing this way Create an rounding_id column in your SQLuse jasper expressions to change the rounding mode and display the valueEx: Since the bigDecimal.setScale does not allow 0, I had to override the normal expression and change it to a string. $F{ROUNDING_MODE}.intValue() <= 0 ? $F{COLUMN2}.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString() : $F{COLUMN2}.setScale($F{ROUNDING_MODE}.intValue() ) <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.4.2.final using JasperReports Library version 6.4.1 --><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="sample" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="6d69f6ac-a0ee-4101-a303-f6fa69e29f54"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select column1, column2, rounding_mode from (select 'milk' as column1, 5.5 as column2, 0 as rounding_mode from dualunion allselect 'jam' as column1, 2.1 as column2, 2 as rounding_mode from dualunion allselect 'bread' as column1, 2.6 as column2, 2 as rounding_mode from dualunion allselect 'coffee' as column1, 8.985 as column2, 3 as rounding_mode from dual)]]> </queryString> <field name="COLUMN1" class="java.lang.String"/> <field name="COLUMN2" class="java.math.BigDecimal"/> <field name="ROUNDING_MODE" class="java.math.BigDecimal"/> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="30" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="80" height="30" uuid="ba03c4fe-513a-471f-9011-7567c7624006"/> <text><![CDATA[COLUMN1]]></text> </staticText> <staticText> <reportElement x="80" y="0" width="100" height="30" uuid="46f4a175-c695-49bd-ab1e-5e66741c5f0b"/> <text><![CDATA[COLUMN2]]></text> </staticText> <staticText> <reportElement x="180" y="0" width="100" height="30" uuid="6d7211c9-9820-49a3-ab46-56d2715c8648"/> <text><![CDATA[ROUNDING_MODE]]></text> </staticText> </band> </columnHeader> <detail> <band height="35" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="80" height="30" uuid="3b7c3652-968d-405d-a188-e25b02c74612"/> <textFieldExpression><![CDATA[$F{COLUMN1}]]></textFieldExpression> </textField> <textField> <reportElement x="80" y="0" width="100" height="30" uuid="20e014b4-6bfc-4e1a-80cb-fbef504aa550"/> <textFieldExpression><![CDATA[$F{COLUMN2}]]></textFieldExpression> </textField> <textField> <reportElement x="180" y="0" width="100" height="30" uuid="91cd58ab-847b-4af6-bd1d-12305b6694cf"/> <textFieldExpression><![CDATA[$F{ROUNDING_MODE}]]></textFieldExpression> </textField> <textField> <reportElement x="280" y="0" width="100" height="30" uuid="db7b95a5-c08a-452a-80c0-3c201713a32a"/> <textFieldExpression><![CDATA[$F{ROUNDING_MODE}.intValue() <= 0 ? $F{COLUMN2}.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString() : $F{COLUMN2}.setScale($F{ROUNDING_MODE}.intValue() )]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  12. It could be the WITH Clause. Jasper by default, does not support the WITH Clause. https://community.jaspersoft.com/wiki/adding-statements-security-validator
  13. that error is caused due to SQLValidation in the xml files. With clause in the SQL is not supported by default. You should Add the With clause to security validator Open jasperserver-pro/WEB-INF/classes/esapi/validation.properties change the Validator.ValidSQL setting to: Validator.ValidSQL=(?is)^\s*(select|with)\s+^;+$
  14. check this blog. personally never used it though. http://helicaltech.com/blogs/internationalization-of-jasper-reports-hello-world-example/
  15. I'm not able to understand your question. why would the Column Header print in the Group Footer ? Those two are separate bands and they dont overlap with each other unless some elements are growing in height. please post a screenshot
  16. I would suggest publishing the report on to the Jasper server and then use the REST API for calling the report. If you still want to use the jsp, there are so many tutorials which can provide you with guidance. (http://www.javaknowledge.info/calling-jasper-report-from-java-web-application-using-jsp/)
  17. The easiest way we have figured out is to convert the pdf into a jpeg and use the Image element.
  18. I believe you are talking about pulling JSON data from an API. Jasper reports can use JSON as a datasource and display the reports. you might need Jaspersoft Studio in order to develop such kind of reports. http://jasperreports.sourceforge.net/sample.reference/jsondatasource/index.html
  19. If you want to consolidate data into one table, then use some kind of ETL tool and populate the data into one database
  20. From my understanding, its not possible to use Single query for two different databases. As you would know already the syntax could be different and it would error out even if its possible. I would suggest using default data adapter concept and join two datasets using a table element https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v611/using-data-adapters-reports-and-datasets
  21. Try creating a Group based on payroll_receipt_id or something which differentiates it from next page. Use the Group Header and Footer to print the fields that are required. That should duplicate it. dont forget to select "Start New Page" on the Group.
  22. <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.4.2.final using JasperReports Library version 6.4.1 --><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="jasperSequenceGenerator" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="04443ff2-e94a-4d12-8600-dd4d5686346f"> <queryString language="plsql"> <![CDATA[{call get_nextval($P{ORACLE_REF_CURSOR}) }/*CREATE SEQUENCE test_sequence START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;create or replace procedure get_nextval(val_cur out sys_refcursor) isbeginopen val_cur forselect test_sequence.nextval from dual;end;*/]]> </queryString> <field name="NEXTVAL" class="java.math.BigDecimal"/> <background> <band splitType="Stretch"/> </background> <title> <band height="20"> <textField> <reportElement x="0" y="0" width="555" height="20" uuid="aeff4ffd-9dc2-46c3-a360-e1d394a002e0"/> <textElement> <font isBold="true"/> </textElement> <textFieldExpression><![CDATA["Current Value for the Unique Sequence is " + $F{NEXTVAL}]]></textFieldExpression> </textField> </band> </title> <columnHeader> <band height="20" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="100" height="20" uuid="faf2370f-082b-4132-8a88-0da19082e770"/> <text><![CDATA[Column Header]]></text> </staticText> <staticText> <reportElement x="100" y="0" width="100" height="20" uuid="ce121043-65ab-485e-8856-731f957806e5"/> <text><![CDATA[Column Header]]></text> </staticText> <staticText> <reportElement x="210" y="0" width="100" height="20" uuid="67be1f25-a9a1-4510-88ff-1405da399d07"/> <text><![CDATA[Column Header]]></text> </staticText> </band> </columnHeader> <detail> <band height="20" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="100" height="20" uuid="10fba0fa-c210-4129-b9fa-c95c37f9250b"/> <textFieldExpression><![CDATA["DUMMY"]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="0" width="100" height="20" uuid="64609422-7400-48a6-81a6-45f6e6a65388"/> <textFieldExpression><![CDATA["DUMMY"]]></textFieldExpression> </textField> <textField> <reportElement x="210" y="0" width="100" height="20" uuid="29d5df8a-fdce-4d0d-829c-1fa90a543e3c"/> <textFieldExpression><![CDATA["DUMMY"]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]If you are still wondering, how to implement this jrxml would help you out if you are using Oracle. Create the sequence using CREATE SEQUENCE test_sequence START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE; then Create a Stored Proc using create or replace procedure get_nextval(val_cur out sys_refcursor) is begin open val_cur for select test_sequence.nextval from dual; end; Switch to plsql evaluation on the dataset and click read fields with {call get_nextval($P{ORACLE_REF_CURSOR}) }
  23. if you are using a database, try creating a sequence in your databasecall that sequence using a plsql block from the datasetdisplay that sequence.nextval from the dataset in your report.documentation for Oracle sequences: https://docs.oracle.com/cd/B12037_01/server.101/b10759/statements_6014.htm documentation for SQL server sequences: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-sequence-transact-sql documentation for postgres sequences: https://www.postgresql.org/docs/9.5/static/sql-createsequence.html
  24. dbo.GetPersonTypeDesc(Incident.IncidentTypeENum,Person.PersonTypeCde) AS 'VALUE' change that 'VALUE' as "VALUE" and see if it works.
  25. If its a database function, your syntax could be correct. I'm saying could be because I dont know the in/out parameters for the function. In order to debug properly, test your function in SSMS first and see if it gives you the required results. your post is contradictory. have you created a function or procedure ?. if dbo.GetPersonTypeDesc is a procedure, then the language should be selected as plsql and it's a different syntax Check here for more info on the execution of MS SQL procedures. https://community.jaspersoft.com/wiki/how-execute-ms-sql-stored-procedure-jasperreports-server
×
×
  • Create New...