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

ejhellerattc

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

Everything posted by ejhellerattc

  1. After 10 years, I had an epiphany. The CSV data source was oriented like the table, just transposed: Day1,1,AJBGT,11:00,12:00,ABCDay2,2,KIUJ3,14:00,16:00,DEFDay3,45,P98U,08:00,10:00,GHI Etc. Since I can control the CSV, if I have the data as three columns: Index, DataType and Value, then I can create a CrossTab that does what I need: Day 1, Plan Number, 1Day 1, Action ID, AJBGTDay 1, Start Time, 11:00Day 1, End Time, 12:00Day 1, Supervisor, ABC The CrossTab has COLUMN_0 as the header, COLUMN_1 as the row label and COLUMN_3 as the data (no computation). Modifying the CrossTab to not have Totals for the Groups prevents the Totals column and row from appearing. Not pretty, but it works. Posted for others who may have wondered. Ed.
  2. I have a report that was written several years ago with JasperStudio. It has a couple of parameters that are passed to it. The first is a value for the WHERE clause of the SQL. The second is the SQL statement itself. The queryString is defined by the parameter: <queryString> <![CDATA[$P!{SQL_QUERY}]]> </queryString> The SQL_QUERY parameter is of a form: <parameter name="SQL_QUERY" class="java.lang.String" evaluationTime="Early"> <defaultValueExpression><![CDATA["select <SQL stuff ....> where determination_value = $P{Device}"]]></defaultValueExpression> </parameter> The Device parameter is defined as a simple java.lang.String data type. This report ran fine in JasperStudio where it was developed and does run fine as part of our application using the embedded methods. However, I switched to using the Eclipse add-in to use JDK 11. With the Eclipse IDE, running the report causes SQL Server to generate and error: Caused by" com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'parameter_Device'. My supposition is that the Jasper Add-In is expanding the parameter, but not replacing the parameter with the value of the parameter prior to issuing the SQL statement. I could not find anything similar in the knowledge base. Has this been reported by anyone or addressed in a newer version? Thanks, Edward.
  3. I have reports that use methods defined in external JAR files. As a result of Oracle's license changes, we have moved to OpenJDK 11 for our development and deployment environments. The external JARs are being built with OpenJDK 11, however, when I try to compile the reports, Jaspersoft Studio reports a version mismatch. I tried to change Studio to reference a newer Java version, but can only change to 10. Even at that, the version mismatch is reported. Is there a way to have Studio use the OpenJDK JARs? If not, is there a timetable for support for openJDK 11 in Jaspersoft Studio? Thanks, Edward.
  4. Thanks for the response. Those are sample reports for basic charts. Perhaps a visual description of what I am looking for will help. The data is derived from a JRDataSource, but an equivalent SQL query might look like: select date, time, voltage from ATableOfData order by date, time Essentially, I need to somehow create multiple distinct series' based on grouping using the date value. The number of series can be expected to be variable. Thanks, Edward.
  5. I have a data stream that has three columns: Date, Time, Value. I would like to be able to generate separate lines based on the date. Thus the time axis is a 24 hour period, with separate lines for the values for a given date. I have tried a time series to no avail. I also tried XY Line and Line Charts, setting the values for the Date and Time columns to Integer. I have tried to define a DataSet that groups by the Date value. Is this something that JasperReports can do or I need to redefine the expectations? Thanks, Edward.
  6. I upgraded to 6.2.0 since I was having issues with 6.1.0 and Java 8. After upgrading, when I select Is For Prompting for a parameter (two parameters, both set), IsForPrompting is not shown in the source view and in Preview I am not prompted for the parameters. Has something changed? Thanks, Edward.
  7. There was a feature in iReports to be able to place fields adjacent vertically. It was the same as the current Join Right and Join Left, just in the vertical direction. In addition to the obvious use of getting things to spcae out vertically, it was also useful to take sequential fields and reorient them from horizontal to vertical. What happened to this option? Thanks, Ed.
  8. We recently switched from iReports to Jasper Studio. In iReports, I had a number of preferences set up. For example, links to external JARs and links to various data sources. A number of the data sources are sample CSV files (simulating the files generated during production) that were established with the correct file name and column associations. Since I saved the iReports configuration when I uninstalled, is there a means to import this information into Jasper Studio so that I don't have spend the time to manually locate each entry in the iReport configuration and tediously enter the information into Jasper Studio? Thanks, Edward.
  9. Thanks for the information. I have been trying out this and other processes (in addition to other tasks). In my initial request, I may have misspoke. The data actually comes from a CSV file (sort like a SQL, but not exactly, thus the misspeak). Because it is CSV, it is not possible with JR to perform SQL queries. Since I have control over the CSV format and generation, I suspect that I am going to have to drop back to a kludge. Every Nth record is the row lables. This, with some print whens to do formatting, allows the report to print the row lables. What is not nice about this approach is that the row lables cannot be a different width than the data. Thanks, Ed.
  10. Have you tried to set up the list of subreports and use the PrintWhen option to determine whether to run the subreport based on the field values? Ed.
  11. Sanda, Attached are the files. Report 5 is the master calling Report 4. Noe that the default subreport directory parameter is changed to a generic. Thanks, Ed.
  12. Sanda, Thanks for the response. I tried the PrintWhen. I set up the label to be PrintWhen based on the Report_Count and not print the value when the label is printed. However, this effectively skips a data row. I also tried the PrintWhen to add a label in the left cell above the data, but it just does not look good. I am unclear about your suggestion to resize the columns. Please note that the table shown is a best approximation using the table control in this forum editor tool, not what my report looks like. Thanks, Ed.
  13. Theoretically simple. Generate a table that is oriented horizontally across the page as part of an overall report that is oriented portrait. Report...... Day Number Day 1 Day 2 Day 3 Day 4 Plan Number 1 2 45 32 Action ID AJBGT KIUJ3 P98U LKIU7 Start Time 11:00 14:00 08:00 13:45 End Time 12:00 16:00 10:00 16:00 Supervisor ABC DEF GHI JKL More Report... In the example, there may be 1 plan or 50 plans. The data comes an SQL query and it makes more sense to send the across the page for up to 10 plans per row than down the page for 5 columns of data. In addition, this is the client requested layout. The data part can be done by createing a sub report that uses the space to create multiple columns and placing the data elements vertically oriented in the detail column. The tricky part is how to have labels for the rows displayed to the left of each row of data. Unlike the Horizontal demo report, I do not want to use real estate by duplicating the label in each cell. I tried placing a set of labels to the left of the sub report reference in the main report, however when the data wrapped in the sub report to create a new row of data rows, the labels were not duplicated. Suggestions are appreciaed. Thanks. Ed.
  14. I am generating a report using iReports 4.1.3. I am posting here because I think this is a JasperReports quesiton not a design question. The report will eventually run from an application via the JR library. However, for development purposes, I use iReports. A parameter will be passed in for the SQL query statement. In that statement will be other parameters that need to be substituted. For development purposes, I set the default value of the query as shown in the attached code. My understanding is that parameters are recursively substituted until resolved. So if there are 2 parameters (P1 and P2 ) and P2 is defined based on P1, should I be able to set up the parameter definitions as: <parameter name="P1" class="java.lang.String"/> <parameter name="P2" class="java.lang.String"/> <queryString><!CDATA[$P!{P2}]]</queryString> where P2 is passed in as a string that contains references to P1 (using $P!{p1} )? If I run the code attached, I am prompted for "StartDate", then the diagnostic as shown below is displayed. Thoughts? Thanks, Edward. Code:Error filling print... Error evaluating expression :     Source text : "select det_id as det_id1, min(archive_date) as date_1 from dbo.detector_archive da2 \ where (da2.archive_date >= $P!{StartDate}) \ and (da2.archive_date < $P!{StartDate}+86400000) \ group by det_id \ order by det_id1" net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :     Source text : "select det_id as det_id1, min(archive_date) as date_1 from dbo.detector_archive da2 \ where (da2.archive_date >= $P!{StartDate}) \ and (da2.archive_date < $P!{StartDate}+86400000) \ group by det_id \ order by det_id1"     at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:203)     at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591)     at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559)     at net.sf.jasperreports.engine.fill.JRFillDataset.setFillParameterValues(JRFillDataset.java:660)     at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:603)     at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1158)     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:802)     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:746)     at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58)     at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)     at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)     at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:879)     at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)     at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: groovy.lang.MissingPropertyException: No such property: P for class: Test_1323723556036_103013     at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49)     at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:86)     at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:239)     at Test_1323723556036_103013.evaluate(calculator_Test_1323723556036_103013:139)     at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:190)     ... 13 moreÂ
  15. Our reports read data via an SQL query. Some of the values returned are enumeration values. In order to obtain meaningful text for the values, we call methods in an external JAR file (i.e., our application). The methods declare the arguments to be shorts. Appropriately the fields are also declared as shorts (java.lang.Short). In version 3.7.3 and earlier this worked fine. In version 4.0.0, the Groovy compiler complains that there is no method available with an argument of Integer. By adding the method ".shortValue()" to the field in the method call, it works. So: With the field name as: <field name="OPERATIONMODE" class="java.lang.Short"/> This worked in 3.7.3: ...findByValue($F{OPERATIONMODE}).getLongName() But for 4.0.0 it had to be changed to: ...findByValue($F{OPERATIONMODE}.shortValue()).getLongName() Any thoughts as to why or how we can avoid the additional coding? Thanks, Ed.
  16. Some food for thought. I modified the query in the subreport to replace the passed in parameter (CategoryPK) with a fixed value (4). The subreport is displayed, but the reported value of the passed in parameter is always 0. When is the value passed to the subreport evaluated? Is it evaluated for each iteration of the list query or when the subreport instance is created? The latter assumes that the subreport instance is created when the primary report is run and referenced for each iteration of the list and not created for each iteration. Thanks, Ed.
  17. A couple of questions: 1) Does the subreport run on its own? If the query generates no results, then the subreport will be blank, but since the main has static fields, the overall report will display. 2) Any particular reason you placed your charts and plots in the Summary band? I would think you would want it in the detail band of the subreport. Ed.
  18. Our database is structured in such a way that part of it is a list of items. Each of the items in this list are associated with additional lists of items. So, for items in table A, they have references (through association tables) to tables B, C and D. I have created a report that, when passed an appropriate key reference from table A, reports the values from tables B, C and D for that item. Since the data from tables B, C and D are only part of the information needed to be presented, what I was hoping to do was create a master report that used a list to loop through the items in table A (using a subdataset) and pass the key to the subreport which would then generate the subreport within the list context. The list is set up correctly, since I can print the key within the list. The JRXML files compile fine and no run time errors. I have noticed a couple of things: 1) The subreport does not appear to be getting an updated key. The value printed for the passed value of the key is always the first record. Thus the SQL always returns the first record. 2) If the generated size of the subreport is larger than the allocated space for the list entry, nothing is printed. This does not follow with the usual behavior of the subreport expanding as needed. Is there a parameter for the list component to allow the list to expand? I have written other reports where the subreport element is 1 pixel high (to get many on the master report) and the subreports display correctly. Any thoughts? I have included samples of the primary and sub reports. Thanks, Ed. Code:Primary Report:<?xml version="1.0" encoding="UTF-8"?><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="SystemConfigurationReport" language="groovy" pageWidth="792" pageHeight="612" orientation="Landscape" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.5"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <subDataset name="Categories"> <parameter name="SUBREPORT_DIR" class="java.lang.String"/> <queryString> <![CDATA[select pk as CategoryPK from CATEGORY]]> </queryString> <field name="CATEGORYPK" class="java.lang.Integer"/> </subDataset> <parameter name="JasperCommonDirectory" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["c:\\reports"]]></defaultValueExpression> </parameter> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["E:\\products\\reports\\src\\JasperReports"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[select description from SYSTEM]]> </queryString> <field name="DESCRIPTION" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <pageHeader> <band height="37"> <staticText> <reportElement x="1" y="13" width="752" height="24"/> <textElement textAlignment="Center" markup="none"/> <text><![CDATA[system Configuration]]></text> </staticText> </band> </pageHeader> <columnHeader> <band splitType="Stretch"/> </columnHeader> <detail> <band height="261" splitType="Stretch"> <staticText> <reportElement positionType="Float" mode="Opaque" x="1" y="42" width="752" height="15" forecolor="#FFFFFF" backcolor="#0033FF"/> <box> <pen lineWidth="0.0"/> <topPen lineWidth="1.0" lineStyle="Double" lineColor="#0033FF"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement verticalAlignment="Middle"> <font size="10" isBold="true"/> </textElement> <text><![CDATA[Categories]]></text> </staticText> <componentElement> <reportElement positionType="Float" x="3" y="63" width="752" height="190"/> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical"> <datasetRun subDataset="Categories"> <datasetParameter name="SUBREPORT_DIR"> <datasetParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></datasetParameterExpression> </datasetParameter> </datasetRun> <jr:listContents height="190" width="752"> <frame> <reportElement positionType="Float" x="2" y="2" width="746" height="48"/> <textField> <reportElement positionType="Float" x="95" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{CATEGORYPK}]]></textFieldExpression> </textField> <subreport isUsingCache="false"> <reportElement positionType="Float" x="0" y="20" width="729" height="28"/> <subreportParameter name="CategoryPK"> <subreportParameterExpression><![CDATA[$F{CATEGORYPK}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "\\SubReport.jasper"]]></subreportExpression> </subreport> <staticText> <reportElement x="0" y="0" width="95" height="20"/> <textElement/> <text><![CDATA[Category PK = ]]></text> </staticText> </frame> </jr:listContents> </jr:list> </componentElement> </band> </detail> <pageFooter> <band height="18" splitType="Stretch"> <textField pattern="MMMMM dd, yyyy HH:mm:ss"> <reportElement x="0" y="0" width="168" height="14"/> <textElement/> <textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> <textField> <reportElement x="632" y="1" width="80" height="14"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="712" y="1" width="40" height="14"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band height="69"/> </summary></jasperReport>SubREPORT:<?xml version="1.0" encoding="UTF-8"?><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="CategoriesReport" language="groovy" pageWidth="612" pageHeight="792" columnWidth="612" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="CategoryPK" class="java.lang.Integer"> <defaultValueExpression><![CDATA[1]]></defaultValueExpression> </parameter> <queryString> <![CDATA[select pk, name from CATEGORYWhere pk = $P!{CategoryPK}]]> </queryString> <field name="PK" class="java.math.BigDecimal"/> <field name="NAME" class="java.lang.String"/> <detail> <band height="64" splitType="Stretch"> <textField> <reportElement mode="Opaque" x="73" y="0" width="192" height="20" forecolor="#000000" backcolor="#C9D8FF"/> <textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" lineSpacing="Single" markup="none"> <font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{NAME}]]></textFieldExpression> </textField> <staticText> <reportElement mode="Opaque" x="0" y="0" width="73" height="20" backcolor="#C9D8FF"/> <textElement verticalAlignment="Middle"/> <text><![CDATA[Category Name:]]></text> </staticText> <textField> <reportElement x="267" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$P{CategoryPK}]]></textFieldExpression> </textField> </band> </detail></jasperReport>
  19. I think others have made some comments, but no one seems to offer solutions. If I load the attached report, select the block of TextFields and move them, iReports goes compute bound for a couple of minutes during which iReports is unresponsive. If the fields are copied from one report to another, the compute time is even longer. I had some reports where I had to wait up to 20 minutes for iReports to finish copying. Am I really the only person having this issue? For reference, my computer is based on an Intel T7200 dual core 2.00 GHz, Windows XP Pro SP3 with 4GB RAM, Java version is 1.6.0_17. Thanks, Ed.
  20. .matches returns boolean (little b) - the data type, not Boolean (big B) - the class. You need to use Boolean.valueOf([boolean_value]) to create your new object. With regard to the paging, you can insert a page break element between your sub reports to get them on separate pages. Ed.
  21. Not sure what caused it, but running a registry cleaner solved this one. Live and learn. Ed. Post Edited by ejhellerattc at 07/02/2010 16:31
  22. I have a new and strange problem that popped up. I have been using iReport on Windows XP for a year or so without problems (latest version was 3.7.0). Recently, it gives an error when loading: The application failed to initialize properly (0xc000007b). Click OK to terminate the application. If I uninstall and reinstall, it runs fine for one iteration. After that I get this message. I tried to update to 3.7.3 with the same results. The only significant change in the system was changing from Symantec AV 10.x to Symantec End Point. I disabled to EP, but still had the same problem. Thanks for suggestions,. Ed.
  23. I found the solution. As I mentioned, the file was an older report that used isSplitAllowed. it also had an incorrect header. It had 1) <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> and 2) only had <jasperReport. Not the additional referential attributes: 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" I am not sure which parts of the latter are required, but removing the DOCTYPE and adding the additional attributes to the jasperReport element(?) allows everything to work correctly. Thanks, Ed.
  24. Thanks for the quick response. Our reporting process is two fold. We generate many static reports that reference a well defined dynamic XML data source. At runtime, based on user selection, we generate a dynamic JRXML file that calls the needed static reports as subreports. This is then compiled and displayed. The problem started with a static report that would not display in iReports, giving an error message like: Attribute 'splitType' is not allowed to appear in element 'band'. Since I could not determine which line caused the problem, I used our "compile" method to compile this file and the output told me which line the error appears on. This was an older report that had been using isSplitAllowed. I modified the file to use splitType (selecting Prevent for false and Stretch for true). When I used iReports to verify the report, I got the above error. I changed the first splitType back to isSplitAllowed to see what would happen. I then ran it through the "compile" method, since it provides the details with the exception message. This told me that the error was on the second band with the first reference to splitType. So - my question is why would I get the error message above given the code snippet from the JRXML file. BTW: I do not wish to get into a discussion about whether dynamic reports should be generated using API calls or generating and compiling a JRXML file. The latter works for us and is much easier to debug, as I can observe the generated JRXML file to verify proper data references and positions. Thanks, Ed.
  25. I am having a problem with the compilation of reports. I am using the API compilation(via compileReportToFile). The compilation fails with the following messages: Feb 4, 2010 9:35:00 AM net.sf.jasperreports.engine.xml.JRBandFactory createObject WARNING: The 'isSplitAllowed' attribute is deprecated. Use the 'splitType' attribute instead. Feb 4, 2010 9:35:00 AM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 35 column 44: cvc-complex-type.3.2.2: Attribute 'splitType' is not allowed to appear in element 'band'. The section of the file it is complaining about is: <background> <band height="0" isSplitAllowed="false"/> </background> <title> <band height="83" splitType="Stretch" > | </band> This was happening with version 3.5.2, so I updated to 3.7.1 and am still getting the same messages. This file will also not load into iReports with the same basic error, however creating a blank report generates statements that it is happy with. Thoughts? Thanks, Ed.
×
×
  • Create New...