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

dgarratt

Members
  • Posts

    36
  • 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 dgarratt

  1. Has anyone got a up to date list of the .jars which need to be on the classpath to support jasper. If any are conditional on the functionality required then which ones are optional and do whatever would be useful. Sometimes I use the lib directory from iReports as a clue - but it obviously has a lot of things for the IDE itself which I don't need. Thanks Dave
  2. I have a java application running in background using java wrapper service. This background process spawns reports when a request is submitted via a database table. As far as I can tell the JasperReports process runs in it's own thread ? Is there a way that my java service application can determine of a report which it's run has finished or still executing ? If there are other threads running in my application which are not related to JasperReports - can I tell the difference between them ? Thanks for any clues in advance. Dave
  3. dgarratt

    Composite Element

    Could we have an update on this issue if possible please as it's still a big problem. Many thanks Dave
  4. If you are printing to a Zebra printer might I suggest that instead of using barcode4j you use native ZPL instructions sent directly to the printers port. I have developed with the help of google a way of sending raw ZPL (text) instructions to a zebra printer. Basically I have a template label defined in a text file with place holders where the data needs to go - then at runtime I load the template document into memory - replace all the place holders with data and send it to the printer. Not only is it much faster to print, but as the printer is doing all the barcode formatting the output quality is much better. I can email you some snippets of code - or you can grab the entire project source from my website www.commander4j.com - you would need b4.zip for the source. The label format attached is from the jasper version of the report. Dave
  5. I am tring to create a barcode using Barcode4j using the EAN128 symbology. My barcode contains the following application identifiers/data (02)nnnnnnnnnnnnnn(20)nn(17)nnnn(37)nnnn(10)nnnnnnnnn The fields (37) and (10) are variable length and I need to specify that there is a field separater (escape) after the 4th digit of the quantity. When I use Barcode4j outside of iReports I can do this by specifying a "Template" for the barcode in an xml file - however there does not seem to be any way to do this within iReports. (02)nnnnnnnnnnnnnn(20)nn(17)nnnn(37)nnnn<FNC1>(10)nnnnnnnnn An example of such a template file is shown below :- <?xml version="1.0"?> <!DOCTYPE barcode SYSTEM "barcode4j.dtd"> <barcode> <ean-128> <height>15mm</height> <module-width>0.3mm</module-width> <check-digit-marker>ð</check-digit-marker> <group-separator>ñ</group-separator> <template>(01)n14(20)n2(17)n6(37)n4(10)an1-20</template> <quiet-zone enabled="true">5mm</quiet-zone> <human-readable> <placement>bottom</placement> <font-name>Helvetica</font-name> <font-size>6pt</font-size> <omit-brackets>false</omit-brackets> </human-readable> </ean-128> </barcode> So at the moment I can't design my Barcode within iReports. Can anyone suggest how I can specify the variable length field delimiter in my report design within iReports ? Thanks Dave
  6. Within my report I call a function within a .jar file. That function needs to read some configuration from a configuration file held within a xml document. The report works fine when deployed within my application. However when I run from iReports it cannot find the xml file - so I need to know what the default "./" home directory is when a report is being run from iReports. Many thanks Dave
  7. I have a couple of workarounds depending on what type of printer you are using. In my project I found out that I could use a call to my own java routine to prepare an image of the barcode and then return that to JasperReports as a finished barcode with the FNC1 included in it. Effectively doing the work outside of JasperReports. If you are printing to a commercial barcode printer like a Zebra you might consider sending native commands to the printer and let it create the barcode for you. You could have a look at my project at www.commander4j.com - but it would probably take a while to extract just the code you wanted from my system. Dave
  8. I've added the lines below in BOLD to my code to get it working. However the code was working with reports that did not contain subreports, and some reports which did providing that they were picking up their parameter from my calling program, and not using a field value from the parent report. resultset = preparedstatement.executeQuery(); jasperresultset = new JRResultSetDataSource(resultset); parameterValues.put(JRParameter.REPORT_DATA_SOURCE, jasperresultset); parameterValues.put(JRParameter.REPORT_CONNECTION, connection); jasperPrint = JasperFillManager.fillReport(jasperReport, parameterValues, jasperresultset); Post Edited by dgarratt at 08/23/2010 17:45
  9. Here is the latest source which matches the output from the previous screen dumps I have uploaded.
  10. This is the log4j output I get :- 2010-08-23 12:51:26,057 WARN [MHN_List_subreport1 subreport filler] net.sf.jasperreports.engine.query.JRJdbcQueryExecuter - The supplied java.sql.Connection object is null. I have attached 2 more images - one showing the output from I report (Main report output in RED, subreport output in BLUE) The second image shows the same report when I run it from my application. The only difference I can think of is that when run from my application I am passing it a ResultSet.
  11. Well I've invested in the relavant "Ultimate Guides" and have to say that they didn't help one jot ! When I run my report (the master top level one) from my application I have told it to print the $P{REPORT_CONNECTION} parameter. It shows as "null" - but all the fields of the master report look fine. When I run the same report from iReports the same field prints "Connection ID:44" I am passing a resultset to Jasper from my Java Swing application. Why does it show a null connection from my application when I run it ? Am I missing a step ? I'm sure this is the root cause for the subreport not appearing as well. HELP HELP HELP HELP PLEASE Dave
  12. Anyone ? I really need to get this one report working very soon. If anyone has a simple example whereby the subreport is using a field from the master reports resultset to use as a parameter in it's own query (aginst a different table) it would be a huge help. Many thanks Dave
  13. Well I've googled this to death and it would appear that I'm not on my own. I can get a subreport to work fine when both the master report and the subreport are using a paramter passed to the main report to retrieve data independantly. What I cannot get working (outside of iReport) is a subreport which derives a paramter from the master report to be used in a where clause. It appears that iReport is doing something that my application is not doing - but I've no idea what. At the moment my application code is generic and calls the standard top level report in the same manner for all reports. It would not be very practical if I had to invoke each subreport from my java swing application. So does the way in which the master (top level) report gets invoked from java change if the master report is modified to include a subreport ? Thanks in advance Dave
  14. I have been doing some more digging and found that the connection parameter does not seem to be populated with anything when run from my application, although this does not seem to prevent it from picking up data from the master (top level) report. Not sure what if any effect this will have on the subreport though. If it should be populated with something then I don't know what with and how. I've attached some more screen dumps. Dave
  15. I have a problem with a report that I have designed using iReport which does not work properly when I run it within my application. Obvisously there is a difference in the enviroment but I cannot identify what it is. My report consists of a physical table called APP_MHN which has a primary key on a field called "MHN Number". I have created a group within the primary report on "MHN Number". My primary report (top level) is called "MHN_Master1". I have a single field "MHN Number" in the Group Header which is keyed on the MHN Number field. So 1 record per group. The SQL for the primary report looks like :- SELECT * FROM APP_MHN I have a second (subreport) report called "MHN_Master2" which I have created which looks at another table. This second table also has as field called "MHN Number" and the query in the second report uses the "MHN Number" from the primary table (report) as a parameter. The SQL for the subreport looks like :- SELECT MHN_NUMBER,DECISION,SUM(QUANTIY) as TOTAL_QUANTITY,count(SSCC) as TOTAL_COUNT from app_pallet group by mhn_number,decision having mhn_number = $P{PARENT_MHN_NUMBER} I have defined the parameter PARENT_MHN_NUMBER in the parent report as being populated by the "MHN Number" field in the primary table. When the report runs from with iReport it works as intended and you can see a sample of the output in the image attached called ireport_output.gif When I run the report from my application I get the output shown in the second attachment called application_output.gif My 1st though was that the SUBREPORT_DIR was not being passed to the master report. So I put an extra field on the master report which showed the content of this field and it seems fine - i,e the same value is displayed within my application as it is within the iReport designer. When I run the report from my Application I am passing the master report my resultset. I'm not sure if iReport is doing the same. I have other reports which include sub-reports which work fine, however the main distiction between them is that the subreport uses the parameter value passed to the main report directly and not a field from the main report. I don't think there can be anything fundametally wrong with the report or it would not work within the IReport enviroment. However I don't know what I am doing differently within the application. It's been a while since I started using JasperReports so I am wondering if I am missing some xml/flat file config information. All I currently use are the jar files. Also iReport seems to have a lot more .jar files (with a few version number changes) than the core Jasper Reports distribution directory. My source for the two reports is attached in case anyone is feeling sufficiently enthusiastic to have a look at it for me. Any help or advice would be very much appreciated. I know how difficult this sort of thing can be to diagnose without access to the database and developent enviroment on my machine. Thanks again. Dave
  16. Looking at the example for barcode4j it is only attempting to print a single application identifier in the barcode as as far as that goes its ok. However if you want to print more that one application id in the barcode and some of those are defined as variable length you need to provide barcode4j with additional information in the form of an xml file. As sample is shown here :- <?xml version="1.0"?> <!DOCTYPE barcode SYSTEM "barcode4j.dtd"> <barcode> <ean-128> <height>15mm</height> <module-width>0.3mm</module-width> <check-digit-marker>ð</check-digit-marker> <group-separator>ñ</group-separator> <template>(01)n14(20)n2(17)n6(37)n4(10)an1-20</template> <quiet-zone enabled="true">5mm</quiet-zone> <human-readable> <placement>bottom</placement> <font-name>Helvetica</font-name> <font-size>6pt</font-size> <omit-brackets>false</omit-brackets> </human-readable> </ean-128> </barcode> The most important line is the <template> part - without which barcode4j will not be able to interpret the data string you pass to it for printing. I've not been able to find any way of passing this information to barcode4j from a jasper report ? If anyone reading this post can help I would be most grateful for help. Thanks Dave
  17. Anyone ? I've still got the same problem. With the EAN 128 standard you need to provide more information to barcode4j than it would appear is possible using the iReport interface. Unless you know better. I would love to get this working in iReports - anyone interested in knowing more about the problem and what I think is needed - please contact me. Dave
  18. Sorry if my heading belies a more complicated question. I would like to call a method from a jar file from within my report. I know that I have to add the jar file to the classpath so that iReports can find it. However my custom jar file expects to be able to read a .xml file from a subdirectory called "./xml" and it assumes that this will be found as a subdirectory of the default startup home directory. I am unsure where I need to create my xml directory so that it can be found when running the report from the designer. I had it all working perfectly within version 3.0, but things seemed to have changed now. Any help much appreciated Thanks Dave
  19. If you want to have a look at my source code you can download the project from http://www.commander4j.com The report is called "barcode" - it calls a method in my application code thus :- <imageExpression class="java.awt.Image"><![CDATA[com.commander4j.bar.JEANImage.getAWTImage("xml/barcode/label_bottom.xml","00"+$F{sscc})]]></imageExpression> <imageExpression class="java.awt.Image"><![CDATA[com.commander4j.bar.JEANImage.getAWTImage("xml/barcode/label_top.xml", "02"+com.commander4j.util.JUtility.padString($F{ean},false,14,"0")+ "20"+com.commander4j.util.JUtility.padString($F{variant},false,2,"0")+ "17"+com.commander4j.util.JUtility.getTimeStampStringFormat($F{EXPIRY_DATE},"yymmdd")+ "37"+com.commander4j.util.JUtility.getFormattedQuantity($F{quantity}.toString(),4,"0")+ "10"+$F{batch_number})]]></imageExpression> The code above produces the 2 barcodes you see on the pdf in my previous post. The filenames in italics tell barcode4j how to interpret the data string. The second expression shown above contains the following application ID's (02)xxxxxxxxxxxxxx(20)xx(17)xxxxxx(37)xxxx(10)xxxxxx The problem with this barcode is that application ID 37 is a variable length field according to the EAN spec, so I have to tell Barcode4j how long it is. This is done by passing my function the name of a barcode template file as a parameter, in this case xml/barcode/label_top.xml This file looks like this :- <?xml version="1.0"?> <!DOCTYPE barcode SYSTEM "barcode4j.dtd"> <barcode> <ean-128> <height>15mm</height> <module-width>0.3mm</module-width> <check-digit-marker>ð</check-digit-marker> <group-separator>ñ</group-separator> <template>(01)n14(20)n2(17)n6(37)n4(10)an1-20</template> <quiet-zone enabled="true">5mm</quiet-zone> <human-readable> <placement>bottom</placement> <font-name>Helvetica</font-name> <font-size>6pt</font-size> <omit-brackets>false</omit-brackets> </human-readable> </ean-128> </barcode> Hope that helps Dave
  20. I've successfully integrated Barcode4j into my project with uses JasperReports. I've had to write some wrapper code which calls the barcode library as an external expression. The tricky bit was handling variable length fields like (37) and (10) where you need to tell barcode4j where the data ends. My wrapper function passes a reference to a XML file which barcode uses to read a template definition from. I've attached a sample barcode as a pdf. Dave
  21. I have a report which I designed in Classic iReports 3.0 which runs fine. However I've been unable to get it to run within iReports 3.5.2. The report requires some of my external jar files to be added to the classpath which I've done using the Tools - Options menu. However when I run the report I always get the same error which is confusing me. I've highlighed the error in the dump below. Error filling print... Error evaluating expression : Source text : com.commander4j.bar.JEANImage.getAWTImage("xml/barcode/label_top.xml", "02"+com.commander4j.util.JUtility.padString($F{ean},false,14,"0")+ "20"+com.commander4j.util.JUtility.padString($F{variant},false,2,"0")+ "17"+com.commander4j.util.JUtility.getTimeStampStringFormat($F{EXPIRY_DATE},"yymmdd")+ "37"+com.commander4j.util.JUtility.getFormattedQuantity($F{quantity}.toString(),4,"0")+ "10"+$F{batch_number}) net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : com.commander4j.bar.JEANImage.getAWTImage("xml/barcode/label_top.xml", "02"+com.commander4j.util.JUtility.padString($F{ean},false,14,"0")+ "20"+com.commander4j.util.JUtility.padString($F{variant},false,2,"0")+ "17"+com.commander4j.util.JUtility.getTimeStampStringFormat($F{EXPIRY_DATE},"yymmdd")+ "37"+com.commander4j.util.JUtility.getFormattedQuantity($F{quantity}.toString(),4,"0")+ "10"+$F{batch_number}) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:197) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:574) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:542) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:872) at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:914) at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:895) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:260) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:486) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1427) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeader(JRVerticalFiller.java:602) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeaders(JRVerticalFiller.java:525) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:254) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:114) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:911) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:814) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:251) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:898) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) Caused by: java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/ConfigurationException at report32name_1245753724493_661143.evaluate(report32name_1245753724493_661143:261) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:186) ... 20 more Caused by: java.lang.ClassNotFoundException: org.apache.avalon.framework.configuration.ConfigurationException at com.jaspersoft.ireport.designer.ReportClassLoader.loadClassData(ReportClassLoader.java:342) at com.jaspersoft.ireport.designer.ReportClassLoader.findClass(ReportClassLoader.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 22 more I'm not that familiar with iReports, but I was curious to see that after I had added my jars to the classpath tab, they then appears on the fontspath tab as well ? Is that normal. I created a dumy report which printed out the classpath in a field when the report was run. It did not seem to include any of the jars which I had added manually - even when I had restarted iReports 3.5.2 I would really like to upgrade to 3.52 but at the moment it is proving more than troublesome. Has anyone got any suggestions which would help me diagnose the true error above. Thanks in advance Dave
  22. Well it seems to work, at least from a printing perspective. However my print preview shows the page as the design length rather than the physical length as determined by the page break. Thanks Dave
  23. I'm going to have to experiment with the report page size etc as I'm not sure how it works when the designed page size is twice the height of the physical page that I'm printing on (e.g. 2 x A5) I'll let you know how I get on. Thanks Dave
  24. Ah ! I see what you mean - label 1 on the group header, label 2 on the group footer, page break in the detail section and the specify that each group should start on a new page. I will try that. Many thanks for the idea Dave
  25. Not sure I understand how that would work. My source data has unique id for each input record so I think I would get a new group for each record, but only 1 group. Can you elaborate on what you mean so I can undertand more. Thanks Dave Post Edited by dgarratt at 06/22/2009 09:35
×
×
  • Create New...