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. Didn't realize you were using columns/colum-headers, options still valid and to be sure I create a sample, have a look at the pdf (attached) I think this is what you are trying to do? Adding a subreport to the page header section. Definitely works for me, I have attached two screen shots to show you what I did, i added a subreport in the page header of the main report and set the size 1x1 just below the text that will appear on each header page. I set the print expression to only run the report on the first page, I pass in an empty datasource, see report1.jpg (attached) On the sub report I just added a title band with the info I want to print, no detail bands will print as the report data source is empty, see report 2.jpg (attached) BTW, I also validated that the other other option using a detail band as a "fake" second page header band works with columns in detail bands but requires a slightly different approach. If the above still doesn't work for you, let me know and I will send further instructions.
  2. This one has been bugging me for sometime, throw it out there in case anybody else has come across it and happens to know of a relatively simple solution. See if I can explain properly Text field with Stretch with Overflow enabled works really nice with the exception of one scenario... When the text exceeds the limit of the field it will automatically wrap the text and auto stretches the field and band provided the text in the field actually contains a word boundary to break on. If there is no word boundary then what happens is that for that detail line the field stretches horizontally and pushes the columns on the right over to accomodate the additional width but only for that detail line, what you end up with is a jagged looking report where the column data get's all misaligned and scattered. I have set net.sf.jasperreports.text.truncate.at.char=true but that property only applies when Stretch with Overflow has been disabled, BTW, works nicely with net.sf.jasperreports.text.truncate.suffix=... so that you get a nice visual, hey textistolongtodisplay... but I REALY WANT TO DISPLAY AND WRAP THE ENTIRE TEXT. I see 3 potential options, that I can think of... 1) wait for dev team to include a "Break on Character" option which which can be applied when Stretch with Overflow enabled 2) Implement some sort of measurer extenstion through net.sf.jasperreports.text.measurer.factory but don't really want to do that because I have limited development skills 3) Check for some sort of max length and insert characters to force word break, easily done but not a fan of this for many reasons, primarily that fonts are not fixed character width so 20 '.' are not the same as 20 'Z's. This is my last resort. Thoughts?
  3. Hmmm, just tried and it worked for me, created a variable with the same name as the parameter and the same variable class as the parameter, set calculation type = system and set the initial value expression to $P{INSERTPARAMETERNAMEHERE} and it assigns the value without issue, at least for me On the subreport object in the main report, there is a property called Return Values where you can define which subreport variables will be passed back to which main report variables.
  4. Going through some of the things I've done with iReport/Jasper and figured some of them are worth of a post in case anybody else comes across the requirement or could use the same technique. Background: When you hyperlink a text field the field uses the standard behavior of underlining the hyperlink and adjusting colors on navigation kicks in and wasn't what I wanted, furthermore based on what I was trying ot do I just wanted a standard color for the hyperlink underline which didn't change on navigation AND the hyperlink only works on the underlined text, In my case I had a color coded count of system matching a certain criteria and wanted the entire field selectable just not a link on the # being displayed. Solution: I created a transparent graphic, a simple transparent gif (attached) , I then added an image object over the text area I wanted to be hyperlinked and set the hyperlink on the image not the text and set the image to fill. Voila, works perfectly and can also be used anywhere you want to put a hyperlink. Note, this only works with output formats which support overlapping elements, HTML doesn't but XHTML does (as does PDF).
  5. I agree with Teodor, Conditional Sytles should be all you need to accomplish this, I use them all the time to color code either the background color or the font color and style based on various conditions and they work amazing. The only time I ever go the route of using multiple fields with print expressions is when I want to physically use graphics such as check boxes or visual status indicators and such. There are lots of posts in the forum on this subject as well as many examples in the sample library and of course the documentation (which is worth the minimal price they charge)
  6. jpauze

    Karma

    Ok, being new to this forum I have noticed that little Karma points thingy off to the side and more and more I find I am obsessed with the thing. Cool that I got me some points and wondering what the purpose is and when I add or remove Karma points for a person, wanting to be a good social contributor and all. My assumption is you add Karma when someone answers a post and actually solves a problem for someone? When do I reduce points? It's all so complicated... The bigger question is, how many Karma points do you need to win a free toaster?
  7. Not sure if you can adjust the main report parameters from a subreport however, could achieve what you are trying to do through usage of variables. On the main report, create a matching variable for the parameter in the main report you want to adjust in the subreport, then pass that variable to the subreport as a parameter, then in the subreport assign the parameter to another variable, adjust it as you need to and then pass the variable back to the main report. On the main report, wherever you were going to use the parameter, use the variable instead as it will have been adjusted as a result of the subreport passing back an updated value. Hope this makes sense.
  8. Not sure what to say, to verify the syntax I put together a quick sample report, same statement, I just changed the position of of the character I'm looking for and the character to find. In my example I am looking for the character 0 and 1 in the 11 position of the text and displaying found 0 or found 1 depending on which character exists. See attached sample. This was the expression I used. $F{host_name}.length() < 11 ? "Unknown" : $F{host_name}.toUpperCase().charAt(10) == '0' ? "Found 0" :$F{host_name}.toUpperCase().charAt(10) == '1' ? "Found 1" : "Not Found" I typically don't preview within iReport because most of my data is coming from a java class in our application, have you tried running outside of iReport preview natively in the application you normally view reports in? are there any error messages displayed on compile or execution? Post Edited by jpauze at 04/21/2011 14:55
  9. Another alternative might be to put a subreport in the page header and set the size really small, say like 1x1 pixel or 0x0 for that matter, then put the print expression on the subreport that way it will only be printed on the page headers you want to include it on.
  10. Let's get creative shall we..... I think I have another alternative as well which I will try but this might work for you. Add another detail band and make sure it's the first detail band. Put this fields you want to show on the first page only in this detail band and set the print when expression to "$V{REPORT_COUNT} == 1" What this will do is only print that detail band for the first record and therefore should print directly after the page header on the first page only. Didn't say it would be pretty.
  11. I see no reason why Jasper/iReport cannot accomplish this, supports everything you need, set your page height, width to match up with your pre-printed paper size including the appropriate margins and then design your report to match the output to the form fields. Will take a bunch of trial and error to set the x,y positions of the text elements to match up with the printed output unless you know exactly what they are. Not overly challenging (in my humble opinion) While I haven't specifically done printed output to a pre-printed from, I have done something similar where I had to have a pre-defined graphic behind the text report and the text elements had to line up at specific x,y co-ordinates to display in specific positions, worked perfectly for me. Personally, I would proboably completely do the form in iReport vs overlay on the pre-printed form unless you have an absolute requirement to use the paper pre-printed form. Either way should work though.
  12. Instead of putting print when expression on the test fields themselves put it on the page header band itself, this will eliminate the band completely except for the first page. Probably the easiest way. I can think of another if that doesn't work for you, let me know
  13. yes most definitely, there are a number of posts on here which deal with this subject. Check the documentation or check the samples library and/or do a forum search for "HTML MARKUP and it will save having to re-type. Essentially you can embed HTML markup tags within your text to get exactly what you are looking for. If you still can't find it let me know and I will post instructions, very straight forward.
  14. This may not be the most elegant solution or efficient option but I am pretty sure it will work, at least it does for me. If someone knows of an alternative cool but this may help you get past your roadblock for now. I have done something very similar so I will try and describe and hopefully it might be of value. The example for how to create a table of contents is still completely valid and should be used. On the main report, implement the table of contents example as per normal, if I recall this involves creating a variable of List type initialized to an Array which then the scriptlet will be used to populate the the table of contents. On the sub report do the exact same thing, we will join them up in a minute, just make sure that the scirptlet is working to build the array for your table of contents on the sub report Now let's join em up... In the main report on the subreport object pass the table of contents variable as a parameter to the subreport, then on the subreport set the intial value of the table of contents variable on the report to be the parameter of the array passed in from the main report. Then you will do the same thing in reverse, set the return variable from the sub report to be the table of contents variable in the main report. What essentially this will do is pass the current table of contents array to the sub report so the sub report will add to any existing elements, then it will pass the array back to the main report so that it can continue adding new entries if needed. Worth a shot.
  15. On Part A of your question, I recall a previous thread which talked about this and something to the effect that the main report will not list the custom variables you created in a subreport and will only list the system defined parameters, not really an issue, as you found just type the name of the subreport variable and as long as you typed the name correctly it will work just fine. On Part B about the variable returned always being null. I have run into this in the past and noticed that if you set the calculationtype to "system" for the variable definition on the main report it returns fine. Whether this will correct your issue or what the technical reason behind this would be I can't answer but give it a try and see it it helps.
  16. Another alternative is to set a filter condition on the datasource itself, that way the rows of data are excluded up front. This would only apply if you want to exclude the rows of data completely from the report.
  17. Appears that this has been addressed in release 4.02, I haven't validated yet but I have been waiting for this fix since it broke, will keep you posted.
  18. I will literally bow down in praise when that feature is added, been trying to do it for some time now and even gones as far as injecting inline javascript to no avail. Haven't used "Generic Elements" yet and will definitely re-visit and see what I can come up with while we wait for the feature. If I find a solution I will post it.
  19. Chart customizers ROCK!!! I have used them for doing to customizatization to all kinds of things. I wish I would have checked out this forum first thought, had to figure it out myself and having your article would have saved me a bunch of time...
  20. From the looks of your example, it would appear to me that your datasource is not sorted correctly, verify the sort order to make sure that you are sorting by Town first and then Result, this should ensure that all your town records are coming through in the correct order.
  21. Not 100% on whether you can dynamically adjust report margins at runtime as this si a report setting not a page setting. Don't think possible but maybe someone who is more well versed in iReport/Jasper than I can confirm. One option (hack) would be to double up the objects and/or detail bands and then control which one prints through a printWhenExpression depending on the odd vs even pages. Example: following print expression would only print if an even page. new Boolean(($V{REPORT_COUNT}.intValue() % 2) == 0) This way you can offset the objects accordingly to get the margin you are looking for on the report. That's all I can think of.
  22. This should work for you. $F{field}.length() < 7 ? "Unknown" : $F{field}.toUpperCase().charAt(7) == 'X' ? "Low" : $F{field}.toUpperCase().charAt(7) == 'Y' ? "Mid" : "High" Added the field length check up front to make sure the charAt index doesn't fail if the string doesn't have an index of 7.
  23. Try changing the isPdfEmbedded="false" to "true" and see if this helps. Also make sure the MingLiU font is on the classpath.
  24. One option would be to convert your statement over to use a UNION between the difference select statements with WHERE clauses for the conditions you are checking for, that way you are going to get multiple rows back from the query which is easily charted.
  25. There is an alternate way to accomplish this which doesn't require two fields and print expressions, embed the condition right into the hyperlink reference, I do this all the time and it works great. Just and example: $P{myParam).equals("DONTPRINT") ? NULL : "HYPERLINK EXPRESSION" Returning null in the expression will disable the hyperlink
×
×
  • Create New...