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. I would write a java class using Jasper api, which would generate the jasper report object and export it to PDF/ iFrame. In order to compile this java class, you can use spring boot or may be even a batch job. then use the sprint boot command or batch job command in the Excel Macro call.
  2. I would use a variable with the below expression. Posted my sample jrxml for your reference <variable name="YTD" class="java.math.BigDecimal" calculation="Sum"> <variableExpression><![CDATA[YEAR($F{MYDATE}).equals(YEAR(new Date())) == true && $F{MYDATE}.before( new Date() ) == true ? $F{SALES_AMOUNT} : BigDecimal.ZERO]]></variableExpression> </variable>[/code] <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.4.0.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="YTD" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="430f67fd-0e51-4761-a175-467cfcb8f8d1"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select to_date('05/05/2017', 'MM/dd/yyyy') as mydate, 5 as sales_amount from dual unionselect to_date('05/10/2017', 'MM/dd/yyyy') as mydate, 6 as sales_amount from dual unionselect to_date('05/15/2017', 'MM/dd/yyyy') as mydate, 4 as sales_amount from dual unionselect to_date('05/20/2017', 'MM/dd/yyyy') as mydate, 9 as sales_amount from dual unionselect to_date('05/25/2017', 'MM/dd/yyyy') as mydate, 8 as sales_amount from dual unionselect to_date('05/30/2017', 'MM/dd/yyyy') as mydate, 4 as sales_amount from dual unionselect to_date('06/04/2017', 'MM/dd/yyyy') as mydate, 6 as sales_amount from dual unionselect to_date('06/09/2017', 'MM/dd/yyyy') as mydate, 6 as sales_amount from dual unionselect to_date('06/14/2017', 'MM/dd/yyyy') as mydate, 6 as sales_amount from dual unionselect to_date('06/19/2017', 'MM/dd/yyyy') as mydate, 7 as sales_amount from dual unionselect to_date('06/24/2017', 'MM/dd/yyyy') as mydate, 7 as sales_amount from dual unionselect to_date('06/29/2017', 'MM/dd/yyyy') as mydate, 7 as sales_amount from dual unionselect to_date('07/04/2017', 'MM/dd/yyyy') as mydate, 7 as sales_amount from dual unionselect to_date('07/09/2017', 'MM/dd/yyyy') as mydate, 7 as sales_amount from dual unionselect to_date('07/14/2017', 'MM/dd/yyyy') as mydate, 7 as sales_amount from dual unionselect to_date('07/19/2017', 'MM/dd/yyyy') as mydate, 8 as sales_amount from dual unionselect to_date('07/24/2017', 'MM/dd/yyyy') as mydate, 8 as sales_amount from dual unionselect to_date('07/29/2017', 'MM/dd/yyyy') as mydate, 8 as sales_amount from dual unionselect to_date('08/03/2017', 'MM/dd/yyyy') as mydate, 8 as sales_amount from dual unionselect to_date('08/08/2017', 'MM/dd/yyyy') as mydate, 8 as sales_amount from dual unionselect to_date('08/13/2017', 'MM/dd/yyyy') as mydate, 9 as sales_amount from dual unionselect to_date('08/18/2017', 'MM/dd/yyyy') as mydate, 9 as sales_amount from dual unionselect to_date('08/23/2017', 'MM/dd/yyyy') as mydate, 9 as sales_amount from dual unionselect to_date('08/28/2017', 'MM/dd/yyyy') as mydate, 9 as sales_amount from dual unionselect to_date('09/02/2017', 'MM/dd/yyyy') as mydate, 9 as sales_amount from dual unionselect to_date('09/07/2017', 'MM/dd/yyyy') as mydate, 9 as sales_amount from dual unionselect to_date('09/12/2017', 'MM/dd/yyyy') as mydate, 10 as sales_amount from dual unionselect to_date('09/17/2017', 'MM/dd/yyyy') as mydate, 10 as sales_amount from dual unionselect to_date('09/22/2017', 'MM/dd/yyyy') as mydate, 10 as sales_amount from dual unionselect to_date('09/27/2017', 'MM/dd/yyyy') as mydate, 10 as sales_amount from dual unionselect to_date('10/02/2017', 'MM/dd/yyyy') as mydate, 10 as sales_amount from dual unionselect to_date('10/07/2017', 'MM/dd/yyyy') as mydate, 10 as sales_amount from dual unionselect to_date('10/12/2017', 'MM/dd/yyyy') as mydate, 11 as sales_amount from dual unionselect to_date('10/17/2017', 'MM/dd/yyyy') as mydate, 11 as sales_amount from dual unionselect to_date('10/22/2017', 'MM/dd/yyyy') as mydate, 11 as sales_amount from dual unionselect to_date('10/27/2017', 'MM/dd/yyyy') as mydate, 11 as sales_amount from dual]]> </queryString> <field name="MYDATE" class="java.sql.Timestamp"/> <field name="SALES_AMOUNT" class="java.math.BigDecimal"/> <variable name="YTD" class="java.math.BigDecimal" calculation="Sum"> <variableExpression><![CDATA[YEAR($F{MYDATE}).equals(YEAR(new Date())) == true && $F{MYDATE}.before( new Date() ) == true ? $F{SALES_AMOUNT} : BigDecimal.ZERO]]></variableExpression> </variable> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="20" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="80" height="20" uuid="226e1b32-e2af-4907-92e0-722b9b3ade13"/> <text><![CDATA[MYDATE]]></text> </staticText> <staticText> <reportElement x="80" y="0" width="100" height="20" uuid="dc9053b9-bd60-481e-9f92-86a71745670d"/> <textElement textAlignment="Right"/> <text><![CDATA[sALES_AMOUNT]]></text> </staticText> </band> </columnHeader> <detail> <band height="20" splitType="Stretch"> <textField pattern="MM/dd/yyyy"> <reportElement x="0" y="0" width="80" height="20" uuid="75031fc7-1a04-441c-844c-4bf3cae3b232"/> <textFieldExpression><![CDATA[$F{MYDATE}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <reportElement x="80" y="0" width="100" height="20" uuid="bbdac3b0-75b9-4f95-9bc7-068c8b3b08b8"/> <textElement textAlignment="Right" verticalAlignment="Top"/> <textFieldExpression><![CDATA[$F{SALES_AMOUNT}]]></textFieldExpression> </textField> <textField evaluationTime="Auto"> <reportElement x="280" y="0" width="100" height="20" uuid="c7339c20-5f2d-4710-933a-f5099e505b40"/> <textFieldExpression><![CDATA[YEAR($F{MYDATE}).equals(YEAR(new Date())) == true && $F{MYDATE}.before( new Date() ) == true ? $F{SALES_AMOUNT} : BigDecimal.ZERO]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="20"> <textField> <reportElement x="80" y="0" width="100" height="20" uuid="9dfdad33-1e39-45f3-9e8b-40fbe8942d4d"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA[$V{YTD}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="0" width="80" height="20" uuid="c51f151c-9f6b-4533-b313-94aa9e78f291"/> <text><![CDATA[YTD]]></text> </staticText> </band> </columnFooter></jasperReport>[/code]
  3. The audit settings allow you to log the activity into the jasper repository database. I would check in the tomcat localhost_access_log to see such kind of login activity.
  4. Inside the group Header or Footer band, there will be Column Cells. The print when expression goes on these Column Cells. Put your expression on all the Column Cells... It should hide the entire group row.
  5. If you would have been using Oracle, I would have suggested going the route of using plsql blocks.
  6. Check this page. its been answered already. http://community.jaspersoft.com/questions/825610/unable-resolve-class-netsfjasperreportscompilersgroovyevaluator
  7. org.postgresql.util.PGInterval can still be found in postgresql-9.4-1202.jdbc42.jar download the jar from below path and use this in the build path. https://jdbc.postgresql.org/download/postgresql-9.4-1202.jdbc42.jar
  8. Try this expression IF(HOUR($P{Field}) > new Integer(0) && HOUR($P{Field}) < new Integer(7),"Non Business Hour",(HOUR($P{Field}) > new Integer(19) && HOUR($P{Field}) < new Integer(24) ? "Non Business Hour" : "Business Hours" ))
  9. https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6.4.1 <!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports --> <dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports</artifactId> <version>6.4.1</version> </dependency>
  10. http://jasperreports.sourceforge.net/config.reference.html The config reference does not have a property through which you can set the protected status for docx. Instead you can disable the DOCX Export options on the Server and Export to PDF.
  11. I have checked my 6.4 Servers and the joda time jar is already there. The server should be shipped with the joda time jar. If someone tried to delete the libraries, then this would occur from my understanding. Just check your servers for any other missing libraries.
  12. Even I got into this error. You can choose the other way of installing the eclipse plugin. https://sourceforge.net/projects/jasperstudio/files/updatesite/6.3.2/fullsite.zip/download Use the above link and download the full site archive. In the eclipse, Help->Install New Software -> Add Button -> Archive Button -> Select the full site Archive -> Give name -> Click OK
  13. You need jaspersoft studio to edit the report. Once you install the jaspersoft studio, you need to configure the report server in the Repositories section of the tool. Once this is done, the folder structure will be visible in the jaspersoft studio and then you can access the jrxml. The other way is to Export the Report by right clicking on the report in Jasper Server and click Export (need proper permissions). Edit the SQL conditions and use js-import batch scripts/Server UI to import the jrxml and xml files into the jasper server. The second option will not work if you want to modify the report layout since the fields from SQL will not be evaluated at the run time. http://community.jaspersoft.com/documentation/jasperreports-server-administration-guide/v550/import-and-export-through-web-ui#import-export_2353750880_1044705
  14. RIGHT($F{ID},6) is working for me. Those double quotes are messing up your result. Remove those double quotes. I dont know why you have inserted those double quotes around the field value. <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.4.0.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="substring" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="53bd2dad-3301-4c64-954e-5b1ba2b00242"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select 'Hello987654321' as ID from dual]]> </queryString> <field name="ID" 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="c0ed5a35-c314-4258-be5f-ed2bbe7c4ce6"/> <text><![CDATA[iD]]></text> </staticText> <staticText> <reportElement x="180" y="0" width="100" height="30" uuid="f74dcaf2-4db0-4336-8761-92d69b0cfbf9"/> <text><![CDATA[Right 6 Values]]></text> </staticText> </band> </columnHeader> <detail> <band height="30" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="337925dd-cccf-4896-b112-2259edcfb1c2"/> <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression> </textField> <textField> <reportElement x="180" y="0" width="100" height="30" uuid="d23925e9-4b17-46c4-921a-0b30ef834197"/> <textFieldExpression><![CDATA[right($F{ID},6)]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
  15. If you have TIBCO support login, download the license key from there and it should be good. just ensure that the first instance services are not running.
  16. Visualize.js is the propreitary framework from Jasper. it is available through commercial editions only. http://community.jaspersoft.com/project/visualizejs The community editions can make use of HTTP api through REST calls and show simple reports on the web apps. http://community.jaspersoft.com/wiki/embedding-using-http-api
  17. I got it to be working after adding dependency jars to the build path. You need jasperreports functions and joda time jars for it to be working. both the jars can be found below. https://sourceforge.net/projects/jasperreports/files/jasperreports/JasperReports%206.2.0/jasperreports-functions-6.2.0.jar/download https://github.com/JodaOrg/joda-time/releases/download/v2.9.9/joda-time-2.9.9.jar
  18. Hi there, just a quick info. Even I got the same error when used on jasperreports api, but it works fine on Jasper Server and Studio. I believe jasperreports api jar does not have all the Jasper Server/Jasper Studio built in functions such as DAYS / DAYSINMONTH etc. Exception in thread "main" net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: DAYS(DATE(1987,02,01),new Date()) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:291) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:618) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:586) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1020) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:568) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:552) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:281) at net.sf.jasperreports.engine.fill.JRFillFrame.evaluate(JRFillFrame.java:163) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:281) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:504) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2026) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeader(JRVerticalFiller.java:613) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeaders(JRVerticalFiller.java:535) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:161) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:558) at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:91) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:456) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:863) at jasperSpfinalTest.FinalTestIterator.main(FinalTestIterator.java:84) Caused by: java.lang.NoClassDefFoundError: net.sf.jasperreports.functions.standard.DateTimeFunctions
  19. The default Value Expression on the Parameters initiates the parameter with a default value. so initiating a default value with nothing should resolve this issue. For example in the below snippet code, my parameter is an arraylist and I'm initiating it with new ArrayList(Arrays.asList()), which is a blank arraylist. <parameter name="paramTest" class="java.util.ArrayList"> <defaultValueExpression><![CDATA[new ArrayList(Arrays.asList())]]></defaultValueExpression> </parameter>
  20. JRDefaultCompiler is deprecated and replaced with JasperCompileManager http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/design/JRDefaultCompiler.html I'm not an expert on the java side, but my guess is that your application is trying to compile the jrxml into a .jasper file using the deprecated methods
  21. For the subreport, table or chart elements, you would find a Dataset options in the properties pane. You can access a button named Parameters. In the parameter options, a parameter mapping should be done from the main dataset to the sub dataset.
  22. Hi Hallie, In order to answer your question, some more information is needed. are you using any database currently for the ERP system that you are developing ? If yes, then it would be super awesome. otherwise you need to extract the information from your ERP using ETL tools and process it for generating reports. This is where Jaspersoft ETL comes into pictureJasper server community installation is pretty simple and can be done with anexecutable - check this guide https://community.jaspersoft.com/documentation/jasperreports-server-install-guide-community-edition-v470 (or)through war file installation for more configuration options. this would require some time and resourcesif this a consulting opportunity, please let me know I can provide some references
  23. Jasper supports $P!{PARAM} to hold the SQL inside a parameter and pass it to the report datasource. Check this: http://community.jaspersoft.com/questions/529203/pparam-vs-pparam If I'm understanding your question correctly, jasper does not support dynamic SQL queries. (it cannot detect the field changes at runtime and modify the jrxml by itself) For example : you can pass "select column1, column2 from table where condition = 1" as a parameter, but the same fields should be evaluated inside the jrxml beforehand. lets say if you pass "select column3, column4 from table where condition = 1" as a parameter into the above mentioned report, it would fail because the evaluated fields column1 and column2 could not be found at runtime.
  24. http://download.oracle.com/otn/utilities_drivers/jdbc/121010/ojdbc7.jar Try using the ojdbc driver in the buildpath
  25. import java.sql.Connection; provide the proper jdbc driver in the classpath and build your connection string. For example: Connection con = DriverManager.getConnection("jdbc:oracle:thin:@database", "username", "password"); Map parameters = new HashMap(); JasperReport report = (JasperReport) JRLoader.loadObjectFromFile("fileLocation"); JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, con);
×
×
  • Create New...