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

jpauze

Members
  • Posts

    116
  • 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 jpauze

  1. Cool Matt, you got to this first, I was going to suggest the same thing with regards to the database as that is the easiest method, just got busy at work and didn't get a chance to reply.
  2. yes, I have done it a few times, and fairly straight forward, just do everything as per normal and then on your subreport put a print expression on the detail band not to print it, will still process the detail rows as required to populate your variables and then pass back to the main report. Give it a shot and I know there are at least two recent posts around the same subject so might want to check those out. Jeff
  3. Post your report and we can have a look to see if we can help. Generic message with no context is difficult to just say do X to resolve. Thanks Jeff
  4. I don't use the query designer because I'm old school and write my SQL from hand :) If I had to guess based on previous query designers I have seen, are you sure that at the database level the FK has been set between the two tables? Generally speaking these types of tools inspect the FK's defined in the database to determine what the relationship is and I have seen many instances where DB designers have not set an explicit FK for various reasons. In this case the Query Designer would have no knowledge that there is a relationship simply by the names of the columns between the two tables.
  5. If you are a Java Developer then you can skip this post, this is for all us non-developers out there who decided to create thier own reports and intially struggle with the amount of Java (Groovy aside) you need to know to be successful. Figured I would start posting some of my personal favorite techniques which have saved me a ton of work and wish I knew them when I was first starting out with iReport. Again, a Java developer will laugh and say duh! of course that is how you do it but if you aren't a developer and picking this stuff up as you go then maybe you will find some value in this. Wouldn't be any fun if I just said do x to get y. Flashback... Creating my first report and to simplify the example let's just say it was to show total disk bytes used for a set of systems, fairly simple right? I create my SQL statement to get the required data, I put the details columns onto my report, I format it the way I want and pat myself on the back for a job well done. I have an integer column which I set the format pattern to include the comma's so it looks nice, I set the display blank if null and then right align the column and send out for review. "Looks great, can you make a few simple changes?,display '-' when the value is zero, add 'MB' to the number and center the field" Sounds easy enough and I am bursting with confidence after creating my first report so quickly. Exaggerating for effect. First Issue, how can I display the '-' instead of the blank, hmm, I know, add a print expression which returns '-' when zerol, ok, but the underlying field type is integer so convert that to string too, oh darn, I can't set a pattern now so lose my pretty numeric formatting. No problem, I will add two fields, one integer and one string then I will control both through a print expression. Now I get my proper formatting and the '-' displayed as required. Now need to add the MB and back to the original string losing format problem, oh well, I add a second field beside my integer column with "MB" and control that through print expressions as well. Ok now how do I center this whole thing seeing as I have two columns now, I give up, you get a report with right aligned text. Sorry. Does all that sound somewhat familiar? Fast Forward... There is a wonderful Java method called String.Format and I recommend you spend time figuring out the various options for what it can do as it has made my reporting life so much easier. The entire episode would have been avoided with the following expression. $F{diskused} == 0 ? "-" : new java.lang.String(String.format("%,d MB", $F{diskused})) The above will display '-' if zero otherwise it will convert a display formatted integer with the MB added. Perfect. There may be alternative ways or even better java coding techniques but when you aren't a developer and learning as you go, my motto is use whatever works. Here is a document on the various options for formatting strings. http://download.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html Hope this helps. Jeff
  6. If you can post a copy of your JRXML file can probably help out, most likely a setting issue. Thanks Jeff
  7. Found a link to the JasperServer User Guide in the documentation area, should have everything you need at least to understand JasperServer capabilities. Section 4.3.3 page 27 is about input controls. http://jasperserver.sourceforge.net/docs/3-5-0/JasperServer-User-Guide.pdf
  8. ah.... I am not a JasperServer user as we have embedded the JasperReports engine directly into our application due to license restrictions. You may want to check the JasperServer forum as I am 99.99% positive it supports user supplied parameters which can automatically populate parameters in your report on execution. May not need the above resource bundle option if you defined your parameters in JasperServer and have it supply your report with what's required. On a side note, if you aren't using JasperServer and have integrated into your application with JavaReports then the only option you are going to have is to build the functionality yourself. I.e. from your application, prompt the user for parameters and then pass them into the report prior to execution. Option 2 in my original response is how we do it, I have a config file which lists the avaialable parameters and whether they can be overriden by the user, defaults, data types etc.. and then out application allows the user to update the parameters before running the report. Works beautiful but this is just building functionality that JasperServer already has natively if you have the choice of using it.
  9. I am thinking it's doubtbul an issue with iReport 4.0.2. I ugpgrade to 4.0.2 of iReport and at the same time our developer made sure the the latest libraries required by 4.0.2 have been upgraded within our application which embeds Jasper Reports for executing them. If I had to guess, you have a mismatched version of a libary on the application server where the reports are being executed especially since they are running fine in iReport and only when you deploy them to your developers that you get it complaining about the paragraph stuff, which was added into 4.0.2 btw :) Wish I could be of more help.
  10. Yes assumed that was what you were trying to do. See if this helps. Step 1 Let's say your report name is 'report1', create a file in the same directory called 'report1.properties' then edit the file and add the following entry IN_STATEMENT=(123455,123445, 512555, 125255) If these are string columns then adjust to the following IN_STATEMENT=('123455','123445', '512555', '125255' ) Step 2 Update your report and set the property Resource Bundle and set the value to 'Report1', without quotes and don't put the .properties extension as it will automatically be looking for .properties file. Step 3 Accessing the property is done via $R{} function so to get the value of the property in the resource bundle specify $R{IN_STATEMENT} and this can be used in expressions. Step 4 I don't think you can use $R{} as part of the SQL statement like you can with $P{} and $P!{} so you need to create a new Parameter on your report, call it IN_STATEMENT, String (turn off prompt for value) and set the initial expression to $R{IN_STATEMENT} Step 5 Adjust the SQL Statement to use the parameter, for instance SELECT field1, field2 FROM table1 WHERE field1 IN $P!{IN_STATEMENT} Voila... Hope it helps.
  11. Use a text file as a datasource or read parameters/properties from a text file? Will assume read parameters/properties froma text file. I can think of 3 potential ways of doing this but hard to say which is best for you as I'm not sure exactly what you are trying to accomplish. Most likely choice would be to use built in functionality of Resource Bundles, typically used for doing string localization but it's essentially a file containing key/value pairs and the integration into iReport is already there so you can use it to store property values. Do a google search or search the forum for Resource Bundles and you should find everything you need. They are very powerful. Couple other options: 1) Create a custom scriptlet which will read the file and pull out the values you are looking for. 2) Depending on how you have integrated Jasper Reports into your application (if you have at all) then you could modify your implementation to automatically read files and set parameters within the report automatically. I do this for my implementation where I have an XML definition for each report which allows me to set parameters (and other neat stuff :) ) outside of the report through a key/value combination and these are automatically passed to the report. Probably a little more involved but is an option. Post Edited by jpauze at 04/28/2011 13:03
  12. I responded to a similar question on the forum yesterday. http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=86916 Hope this helps.
  13. This is probably more a JasperServer question no iReport. Here is a post from the JasperServer forum which may help out. http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=67863
  14. Thanks for coming back and posting your solution :)
  15. Micky, shoudl be fairly straight forward. Add the following property to your report net.sf.jasperreports.export.xls.one.page.per.sheet = true (default is false) This will force every new page to a new sheet within your workbook. I would enable ignore pagination for the report then in the Group Header add a page break element from the palette. Another property to look at is net.sf.jasperreports.export.xls.sheet.names which will allow you to control the sheet names that get created for each group. There are many posts in the forum on this topic and a google search on the property always brings back some good stuff. Hope this helps. Jeff
  16. There are a ton of posts on the forum with how to use Parameters in SQL statements, both for doing parameter substitution as well as dynamically building SQL strings. Just do a search for Parameter and you can usually find what you are looking for. Here is a similar one I responded to recently and I know Matt has a number of posts on this topic. http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=86329
  17. Glad you found a solution, Gail was on the right path as well and probably what I would have done. There are a ton of posts on the forum with how to use Parameters in SQL statements, both for doing parameter substitution as well as dynamically building SQL strings. Just do a search for Parameter and you can usually find what you are looking for. Here is a similar one I responded to recently and I know Matt has a number of posts on this topic. http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=86329
  18. Matt, you are a rockstar! I implemented the scriptlet to add the Zero Width Space as suggested and it works exactly as advertised. I have attached a sample image showing the before and after effect of using this. In the before you will see how the right column shifts for only certain details rows that couldn't break on word, after, everything is perfectly aligned. Note: Your sample code was adding "u200B" to the string but it should be "\u200B", still totally appreciate the extra time you spent adding this sample for me. For all those newbies out there, I have to add that my entire Java development experience is a result of what I learned in expressions within iReport and the fact that I could install NetBeans and figure out how to actually create a scriptlet class from the sample provided by the documentation is pretty cool. May have just unleashed the beast. Jeff
  19. This was also asked and answered in the iReport forum http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=75562 Hope this helps Jeff
  20. I have done this quite a bit as well, it's irly straight forward, on the subreport just have a detail band with a print expression new Boolean(false) and no other bands, this will force the report to be run and the variables populated and returned but no output content. Make sure the variable on your main report is set to System. Should work Jeff
  21. In the documentation section there is a tutorial on enabling Jasper Reports in Java Applications, there is a complete list of the required Jar files for the various open source tools and Jasper Reports itself. http://jasperforge.org/website/ireportwebsite/IR%20Website/ir_deploying_reports.html?header=project&target=ireport I haven't found a similar document which outlines the 4.0.2 file versions but for myself my organization has been upgrading as each version has been released and the release notes for each version have been good at documenting which versions have been upgraded along the way so might want to review those as well. This question is probably more suited for the Jasper Reports Forum not the iReport Forum so you might want to check that group and see what you can find. Jeff
  22. Are you having a specific problem or just asking how to register a new JDBC driver? Select Windows\Services and then under database/drivers under the services pane right click on the Drivers node and select Add Driver and add your jar file. If you have done that and are having an issue please post the issue and maybe someone can assist. Jeff
  23. Here is a link to Matt's article and samples for creating chart customizers. http://mdahlman.wordpress.com/2011/04/17/chart-customizers-2/
  24. Seems like a very common question, has been asked a number of times in this forum and there are only two references which even hint to a solution, natively it doesn't support from within jasper and you would have to create a chart customizer to extend jFreeChart which should support the capability. I know Matt has recently posted a sample chart customizer example so that may be a starting point for you. If you do create one then please, please, please re-post it here so others can use it. If I get to it first I will do the same thing but I currently don't have a need for it at the moment. Jeff
  25. Anybody know how or if you can reference Jasper Properties from within iReport directly? Which property is irrelevant but for argument sake let's say 'net.sf.jasperreports.text.truncate.suffix' how could i reference the value set for this property in an expression so that I can display which suffix has been defined or if at all? I know I can modify our Jasper Reports integration to pass in the value as a parameter or via custom scriptlet but looking to see if anybody has come across and easier solution. Thanks in advance, I have searched EVERYWHERE Jeff Post Edited by jpauze at 04/26/2011 21:55
×
×
  • Create New...