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

mdrg

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 mdrg

  1. Hello, I reported this as a concern about the default handling of NullPointerException a while back, but unfortunately it got no attention. I'd like to know what's the reason for this behavior, and maybe if it could be made configurable in the future. I'm copying the bug description here: Any exception that may happen during field evaluation (either direct field expression or scriptlet method) always propagate up the stack, aborting the report, except NullPointerException. It's obvious that all values should be tested for null, but the programmer may forget to do all the needed tests sometimes, or the data which was expected to exist is missing. Such situations that cause NPE's get silently evaluated to null. I don't know the reason behind this explicit exception swallow, but I'd like my reports to abort on any exception that may arise, including NPE's, and I dare to say that's what most programmers would expect (at least the Java ones, that may frequently deal with scriptlets, where such exceptions are far more likely). I'm currently running my local report tests on custom JasperReports 4.0.0 build with NPE catch blocks removed, no issues. I suggest the creation of new report option (probably report-wide), like 'When NullPointerException on evaluation', with values 'Evaluate to null' (default, to keep backward compatibility) and 'Propagate'. Bug URL, with sample report: http://jasperforge.org/projects/jasperreports/tracker/view.php?id=5203 Thanks!
  2. I missed this property, thanks! Someone with thoughts on my second question, still welcome ;-)
  3. If I got this correctly, just use 'remove line when blank' on the text field.
  4. Try adding the JDT compiler to your client machines. Its the recommended compiler according to the requirements: http://jasperforge.org/projects/jasperreports
  5. You already asked it : http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=86480 If your set of possible column variations is small and predictable enough, you can use multiple subreports and choose which one you wish to display. Otherwise try DynamicJasper.
  6. Please, anybody can share some light with me on this? Thanks!
  7. Try DynamicJasper: http://dynamicjasper.com/ It is built upon JasperReports and provide ways to define reports with dynamic layouts.
  8. This is not related to Jasper. You should try some Java programming community.
  9. I believe that grouping is exactly what you need to perform this kind of task. Read a bit about "groups" functionality, that's probably what you need.
  10. Set the text field markup to "styled" and use <style isBold="true"></style> around the text you wish to be bold. Where to put this tag is up to you, according to your requirements and needs. You probably can do it easily with String manipulation methods, as long as you can locate the text you want to be bold. I suggest you do this on a Scriptet, so you can use all of Java String manipulation methods and classes. Post Edited by mdrg at 04/15/2011 11:51
  11. You may join them in a single document creating a "master" report and adding the multiple jasper files you have as subreports. Give it a try.
  12. Why don't you do the opposite? Query the data in your application and use it to create the table. If the user requets a report, send the same data using a bean collection/array datasource to populate the report.
  13. I'm still hoping to get an answer. Thanks!
  14. Use 'ignore pagination' option on your reports and you'll get a report with no pages, as a single, very tall page.
  15. Integer pageNumber = (Integer)getVariableValue("PAGE_NUMBER");
  16. You can record the dates around the call to the JasperFillManager, like below. Code:Date startTime = getCurrentDate(); //get date the way you need... new Date, DB sysdate or whateverJasperPrint print = JasperFillManager.fillReport(reportStream, paramseters, dataSoruce);Date endTime = getCurrentDate();
  17. It may not be your whole issue, but what I can say: First, do not include the REPORT_SCRIPTLET parameter; you should only add the class name as the Report Scriptlet on the report properties; Jasper will create the scriptlet when needed; Second, this code is wrong: (pckAcadRelatorios.Scriptlets.HeadingsScriptlet)($P{REPORT_SCRIPTLET}).addHeading("ShipCountryGroup") This way you are casting to the scriptlet class the result of the 'addHeading' call. Rewrite it like this: $P{REPORT_SCRIPTLET}.addHeading("ShipCountryGroup") Third, 'printWhenExpression' must evaluate to a boolean, telling if the field should be displayed (true) or not (false). 'addHeading' souds like a method that do the actual heading addition, so it should be in the 'expression' field.
  18. You are using DynamicJasper, this forum is about JasperReports. Dynamic uses JR, but with a new layer of API over it. You should post your questions to the DynamicJasper forums.
  19. Have you tried using subreports? Create a fourth (master) report that includes the other three as subreports the way you want. Try it and post back if it worked, or if you need any other help.
  20. You need to set the correct markup type to be used by your text field. If you are using iReport, select it in the "Markup" combo near the end of the properties of your text field. The default is "none", so any XML tags will be displayed as-is. If you are creating the jrxml file directly I may get from one of my reports and post the code... and then I'd suggest you to download iReport ASAP. /tools/fckeditor/editor/images/smiley/msn/teeth_smile.gif Post Edited by mdrg at 03/31/2011 13:52
  21. Hi, Jasper supports html, rtf and an "internal" markup, called "style". You should be able to display your html-styled text without problems. However, I'm also creating a report, and I had problems getting it to work with HTML (maybe there's a restricted set of recognized tags), so I decided to use the "style" markup, which is working perfectly for me. This markup is XML ( <style isBold="true" isItalic="true" isUnderline="true" isStrikeThrough="true" size="36" backcolor="yellow" forecolor="magenta"></style> ), very easy to use. May you have problems with the HTML tags, you may process the text and replace it with style tags. But I'm a novice with Jasper too, I may have screwed it up with HTML. /tools/fckeditor/editor/images/smiley/msn/wink_smile.gif Kind regards. Post Edited by mdrg at 03/31/2011 11:50
  22. Hi, I'm a novice Jasper user (a month on it), and I'm having a really nice time designing a very complex report. But I found a situation I'm uncomfortable with. Due to the complexity of the data involved, I use a lot of scriptlet methods to do the dirty work, and one of these generated a NullPointerException because of a missing DB record (corrupt database, our DB is a jaw-dropping awful legacy mess). It made the field that called this method silently evaluate to null. IMHO, this is terrible... any exception but a NPE would cause the report generation to abort, which is perfectly fine, if you ask me. I debugged the source, and found out that NPEs are intentionally swallowed (JREvaluator.evaluate*). Why is that? I know that every data should be tested, but some bit of code may slip by. I see that now I need to wrap every method of my scriptlets with a try-catch block to capture NPEs (any other alternative?) Why is there such code for NPEs? If there is a reason for that (and also because you wouldn't break backwards compatibility), maybe you could provide a report-wide property 'When NullPointerException on evaluation' with values such as 'Evaluate to null' (default) and 'Propagate exception'. Thanks!
  23. FileInputStream is intended for -files-, local disk files. Just read the error message, it is very descriptive.
  24. First, it's hard to find a situation where makes sense to compile a report (jrxml) file in your running application, and it seems your application have no need for this. You should keep the 'jrxml' files as part of your project, but only include the 'jasper' into the classpath, as it is already compiled and ready to use. As an example, in my project I keep the 'jasper' files into a 'resources' source folder, which will be included in my packaged application, so it can be easily loaded. The snippet below should make it clearer. So, put the 'jasper' files in your application classpath, and leave the source files (jrxml) out, as they will be useless for your running application. Code: Post Edited by mdrg at 03/25/2011 16:40
×
×
  • Create New...