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

brossow

Members
  • Posts

    23
  • Joined

  • Last visited

brossow's Achievements

  1. Subject more or less says it all. In an iReport Designer 5.6 template, I've got a data table of variable length that may or may not split across a page. Is there any way to force an earlier page break if it would leave only a single row of data at the top of the next page (i.e. similar to widow/orphan control in Word)? I know how to use grouping and the minimum height to prevent orphans, but I've found nothing to prevent the situation I described. Not allowing the table to split isn't an option. Thanks in advance, and apologies if I missed something obvious.
  2. *sigh* As my luck usually goes, after giving up and posting the question, I've solved my own problem. The particular data I was testing against wasn't populating the Quote_Type field correctly. Once the field was populated, the .replace function works exactly as expected. Never mind....
  3. I am working on a report (using iReport Designer v.5.6.0) where I need to read the value of a key from a properties file (i.e. a resource) and replace certain strings within it with actual field values. For example, if the following string is the resource value: Thank you for your request for a QUOTE_TYPE quote for a new whirlygig. I need to replace QUOTE_TYPE with the actual value of the field $F{Quote_Type}, so for example the output would be like this: Thank you for your request for a budgetary quote for a new whirlygig. I have tried the folllowing (and variations thereof) in the text field expression, but it only returns null: $R{cover.letter.body.html}.replace("QUOTE_TYPE", $F{Quote_Type}) If I remove the '.replace....' portion of the expression, the string is read in and displays as expected, so it's not a matter of me messing up the resource. If I replace the field $F{Quote_Type} with "TEST" it replaces the text in question appropriately, but I need to show the field value. Suggestions? Am I missing something obvious? Ultimately there are a couple more strings in the same resource that I'll also need to replace, but I want to get one working first. Clearly this is not my area of expertise. Thanks in advance!
  4. We are using iReport Designer 5.6.0. We have a customer who has a set of T&C documents in PDF format and their legal team insists that they must be used exactly as provided, down to the exact word that ends a column/page, and so creating them as regular templates is out of the question. The exception to this is that they ALSO must have a footer with page numbering added so that if a T&C document gets added to the end of a quote, the page numbering is continuous through the end of the generated PDF. Aside from converting the various PDF pages to individual image files and inserting them into the template, is there any other way to take the PDFs as they are and just add page numbering? I'm guessing not, but before I start the image conversion I thought I'd ask. Any ideas are appreciated.
  5. Thanks, but in your example the detail band is repeating and the number is incrementing based on results of a query (i.e. a list of countries resulting from the field $F{SHIPCOUNTRY}). In my case, the text displayed will not be the results of a query but rather static text that already exists in the report. The only dynamic elements will be the numbering (which I need to be sequential) and the visibility (based on the 'Print when expression') of each band, frame, etc. (that is, whichever of those I decide to use to determine visibility of the item and its corresponding number). To be clear, the list items (Apple, Orange, etc.) that need to be sequentially numbered will _not_ be read in from a query but will already exist in the template. Hope that makes sense.
  6. I am developing a report (in iReport Designer 5.6.0) that is mostly static and it includes a number of text fields that are optional based on very simple logic. I need these to be a numbered list where the numbering is sequential only for those text fields that are displayed. I know how to use a count-type integer variable when trying to, for example, enumerate query results. But for the life of me I can't figure out a way to make a numbered list that isn't based on a group (there is nothing to be grouped) or counting the results of a query (the list isn't query results). So for example, let's say I have the following text fields: ApplesOrangesOnionsBananasCarrotsPeachesIf I wanted to show them in a numbered list based on just those that are orange, let's say, then my list should look like this: OrangesCarrotsPeachesBut using those same text fields, I may also want to create a sequentially numbered list where only the ones that are fruit are displayed: ApplesOrangesBananasPeachesI found this old thread elsewhere via Google, but there's not enough info in it to help me solve this problem. Is there any way to create a variable that auto-increments without needing to count query results, do grouping, etc.? Obviously I'm not an expert developer and am looking for a solution that's contained within the template (i.e. no external server functions, scripts, etc.). For what it's worth, my actual implementation will be long strings of text, not just one or two words -- the above is brief for better clarity. I tried using an HTML-formatted field and using numbered list tags, but the output was unacceptable. (I need hanging indentation and other formatting that HTML within the text field isn't accomplishing, so I need the actual numbers in standalone text fields.) Thanks in advance for any help!
  7. I did find the ireport.properties file in <user>.ireport5.6.0configPreferencescomjaspersoft and was able to renumber some of the executers, but that doesn't move them up above the built-in executers, which is where I'd really like them. Any suggestions are much appreciated.
  8. For our implementation using iReport Designer 5.6.1, we have a handful of custom query executers defined and do not use any of the built-in executers. When I add a new query, then, I have to scroll to the bottom of the list to select one of the custom executers. While I don't want to completely remove the standard executers (you never know when you might need one), I would like to move them to the bottom of the list so the ones I use most are at the top. Is this possible? I cannot find a way to move them from within the iReport Designer options, and a cursory search of the directory where iReport Designer is installed didn't reveal anything that seemed a likely candidate for manual editing.
  9. Disregard. I was able to solve my problem my rearranging the JSON and flattening it out more. By passing a new (in this bogus example) customer ID field to the vehicle nodes, I can group by customer ID and it loops through the vehicles beautifully. The moral of the story is that sometimes the answer isn't to change the template but rather to change the data its being fed.
  10. I am trying to create a report in iReport Designer v5.6.0 that loops through a JSON file and returns all data from different levels. For example, I've built a very simple JSON file that has a list of customers, and for each customer it lists all of his/her vehicles including fields for make, model and mileage. The desired output would be a list of customers and underneath each customer a list of the vehicles he/she owns. I have built a template that correctly displays each customer name, but I have been unable to figure out how to loop through each customer's vehicles. (I can return the first vehicle by adding [0] to the field, but I can't figure out how to loop through all vehicles.) JRXML: [/code]<?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="report1" language="groovy" pageWidth="612" pageHeight="792" columnWidth="540" leftMargin="36" rightMargin="36" topMargin="36" bottomMargin="36" uuid="20a5fd88-b322-439b-b413-75d8da29ff65"><property name="net.sf.jasperreports.json.source" value="simple_json_cars.json"/><property name="ireport.zoom" value="1.5"/><property name="ireport.x" value="0"/><property name="ireport.y" value="0"/><queryString language="json"><![CDATA[]]></queryString><field name="custName" class="java.lang.String"><fieldDescription><![CDATA[custName]]></fieldDescription></field><field name="carMake" class="java.lang.String"><fieldDescription><![CDATA[custCars[0].carMake]]></fieldDescription></field><field name="carModel" class="java.lang.String"><fieldDescription><![CDATA[custCars[0].carModel]]></fieldDescription></field><field name="carMiles" class="java.lang.Double"><fieldDescription><![CDATA[custCars[0].carMiles]]></fieldDescription></field><detail><band height="60" splitType="Prevent"><textField isStretchWithOverflow="true"><reportElement x="0" y="0" width="540" height="18" uuid="b96f609f-80ad-4fa1-a92a-55ccf9eb9fcc"/><textFieldExpression><![CDATA[$F{custName}]]></textFieldExpression></textField><textField isStretchWithOverflow="true"><reportElement x="90" y="18" width="450" height="12" uuid="dc88d116-bfaf-4495-bf5c-74065aa798bd"/><textFieldExpression><![CDATA[$F{carMake} + " " + $F{carModel}]]></textFieldExpression></textField><textField pattern="#,##0.0"><reportElement x="90" y="30" width="450" height="12" uuid="c5f47711-29f8-425d-a2d7-23bb26bc2d0f"/><textFieldExpression><![CDATA[$F{carMiles}]]></textFieldExpression></textField><textField><reportElement x="36" y="18" width="54" height="12" uuid="042eb8b6-ee5c-40e4-a683-b36ade763b66"/><textFieldExpression><![CDATA["Vehicle:"]]></textFieldExpression></textField><textField><reportElement x="36" y="30" width="54" height="12" uuid="bb446f69-b731-4221-b9d5-a9186282ad4b"/><textFieldExpression><![CDATA["Miles:"]]></textFieldExpression></textField></band></detail></jasperReport> JSON: [/code][{"custName": "Alison Anderson","custCars":[{"carMake": "Chevrolet","carModel": "Avalanche","carMiles": 97740},{"carMake": "Chevrolet","carModel": "Beretta","carMiles": 165500} ]},{"custName": "Bart Bloomfield","custCars":[{"carMake": "Ford","carModel": "F150","carMiles": 43252},{"carMake": "Mercury","carModel": "Marauder","carMiles": 26699} ]},{"custName": "Charles Cominsky","custCars":[{"carMake": "Porsche","carModel": "Cayman","carMiles": 15520} ]}] Any help is greatly appreciated.
  11. Unfortunately, that's well beyond my level of experience. I build report templates but am not a developer with Java experience.
  12. I've got a list of strings that are being pulled from a properties file, each of which is displayed according to various criteria. This should result in a sequentially numbered list with no gaps. There are too many possible combinations to hard-code the numbering, so I'm looking for a solution to number them dynamically. To be clear, this text isn't being returned as rows of data that could simply be counted. I am currently using HTML's numbered list tags (ol wrapper with li inserted before each string) to number the list as the strings are concatenated in a text expression, but the PDF output is less than acceptable as instead of a hanging indent it's indenting the first line of each paragraph and it comes out looking like paragraphs in a book rather than a neatly numbered list, so I need to find a different solution. What I've got in mind is an integer variable that would increment each time it's called, which could then be inserted before each string to be included in the text field, but nothing I've tried in various combinations of calculation and reset/increment types has worked. Is there any way to do this, or is there a more obvious solution I've overlooked? Thanks for any suggestions.
  13. I have a report with a block of text at the end (footnotes, about 18 lines in 7pt font) that's roughly two inches tall. I know how to prevent it from printing just a line or two at the end of a page, but is there any reliable way to keep it from printing just a line or two on the last page? Ideally it wouldn't break if there's less than an inch of space available at the end of a page, but would break if less than an inch would overflow onto the next page (in other words, if it needs to split, it would split approximately in half). I suppose I could split the text into two fields in two bands about an inch tall, neither of which is allowed to split. It's not ideal, but if there's no other solution it would be better than having a line or two of text on a page by itself. I'd much rather keep the whole block as a single field for easier maintenance (we pull the text in as a resource from a properties file). Thoughts? I'm using iReport Designer 5.6.0 if it matters. Thanks!
  14. Not sure the subject describes exactly what I'm after, but I hope it's close. Short version is that we want to do some complex calculations that ultimately return a string like 'resource.key.1' that we could in turn use to return the value of a key from a properties file. In other words, we'd like to turn this: $F{resourcekeyfield} (with a value like 'resource.key.1') into this expression: $R{resource.key.1} I tried several things (such as $R{$F{resourcekeyfield}} for example) but of course nothing worked. Any suggestions are more than appreciated! Thanks in advance.
  15. I don't know what happened, but I haven't had a chance to do anything to this template and suddenly it's working as expected without any odd spacing as described above. Gotta love problems that fix themselves ... not (since you never know when they're going to reappear out of nowhere). Might still try the ordered list solution, but it's suddenly dropped a lot lower on my list of priorities.
×
×
  • Create New...