Jump to content
Changes to the Jaspersoft community edition download ×

dcherk

Members
  • Posts

    12
  • Joined

  • Last visited

dcherk's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Yup, that was a newbie question. When I created my very first report ever, I used iReport's wizard. It asked be how many columns I wanted, and I said 5, thinking I had 5 database columns that I was using. And that answer has been cut-pasted all over the place. Thanks for your help, Dave Cherkassky
  2. And here is the output. [file name=renewal_2006_08_03.pdf size=45286]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/renewal_2006_08_03.pdf[/file]
  3. This is probably a newbie question, but here goes. I've got a report (attached) that looks fine, as long as the text is not too long. Once the text grows too much it renders on top of inself on the same page rather than starting a new page. I a way it seems like its starting a new column rather than a new page, but I am completely confused as to what's going on. I'm attaching the jrxml file in this post, and the sample PDF output in the following post. Thanks in advance, Dave Cherkassky DJiNN Software Inc. http://www.djinnsoft.com [file name=renewal-f5cadcd26f4657a70a1997a10fb749f9.jrxml size=24615]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/renewal-f5cadcd26f4657a70a1997a10fb749f9.jrxml[/file]
  4. Teodor: I understand why it happened from a technical point of view, and I've already implemented a work-around. But what I am saying is that its not very usable from a business point of view, so I think you might want to improve the functionality here a little bit... Thanks for your explanation though -- it'll help me think of other scenarios that might result in similar issues and write some preventitive code. Dave Cherkassky.
  5. I can't seem to log an issue into the bug system, so reporting it here: I've got an isStyledText==true field, and it just so happened that the field's value evaluated to: <font size="200%">public </font>notes. This resulted in the following exciting exception: java.lang.NumberFormatException: For input string: "200%" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1207) at java.lang.Float.valueOf(Float.java:205) at java.lang.Float.<init>(Float.java:289) at net.sf.jasperreports.engine.util.JRStyledTextParser.parseStyle(JRStyledTextParser.java:362) at net.sf.jasperreports.engine.util.JRStyledTextParser.parse(JRStyledTextParser.java:140) at net.sf.jasperreports.engine.fill.JRFillTextElement.getStyledText(JRFillTextElement.java:466) at net.sf.jasperreports.engine.fill.JRFillTextElement.getText(JRFillTextElement.java:492) at net.sf.jasperreports.engine.fill.JRFillTextField.prepare(JRFillTextField.java:485) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:345) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:311) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:275) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1291) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupFooter(JRVerticalFiller.java:685) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupFooters(JRVerticalFiller.java:659) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:239) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:132) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:750) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:647) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234) at net.sf.jasperreports.engine.JasperRunManager.runReportToPdf(JasperRunManager.java:203) That's a bit harsh. Perhaps like in other cases where the styled text violates the styled rules, JasperReports should just output the raw text rather than throwing such a nasty exception. This is particularly painful for me, because the text is submitted by the user -- for me, it is not part of the report defininition, so it is very hard to catch such a problem. Thanks, Dave Cherkassky DJiNN Software.
  6. Yes, that worked. For completeness, here is the final answer: Code:<variable name="public_notes" class="java.lang.String" resetType="Group" incrementerFactoryClass="com.aimcompanies.website.reports.RenewalPublicNotesIncrementorFactory" incrementType="Group" incrementGroup="coverageTypeCode" resetGroup="applicationId" calculation="Sum"> <variableExpression> <![CDATA[( $P{public_notes}.containsKey( $F{coverage_type_code} ) ? ( String )$P{public_notes}.get( $F{coverage_type_code} ) : null )]]> </variableExpression> <initialValueExpression> <![CDATA[""]]> </initialValueExpression> </variable> and the RenewalPublicNotesIncrementorFactory is: Code:[code]public class RenewalPublicNotesIncrementorFactory extends JRAbstractExtendedIncrementerFactory { public static JRExtendedIncrementer INCREMENTOR = new JRAbstractExtendedIncrementer() { public Object increment( JRCalculable variablePublicNotes, Object publicNote, AbstractValueProvider abstractValueProvider ) throws JRException { String publicNotes = ( String )variablePublicNotes.getIncrementedValue(); if( publicNotes == null ) { publicNotes = ( String )initialValue(); } if( publicNote != null && publicNote.trim().length() > 0 ) ) { if( publicNotes.length() == 0 ) { publicNotes = ( String )publicNote; } else { publicNotes = publicNotes + "<BR/>" + publicNote; } } return publicNotes; } public Object initialValue() { return ""; } }; public JRExtendedIncrementer getExtendedIncrementer( byte calculation ) { if ( calculation == JRVariable.CALCULATION_SUM ) { return INCREMENTOR; } else { throw new UnsupportedOperationException( "RenewalPublicNotesIncrementorFactory can only do Sum calculations" ); } } } Many thanks, Dave Cherkassky
  7. Thanks, Teodor. You've given me something to think about. Just a quick follow-up. I changed the variable not to refer to itself and to use calculation="Sum": Code:<variable name="public_notes" class="java.lang.String" resetType="Group" incrementType="Group" incrementGroup="coverageTypeCode" resetGroup="applicationId" calculation="Sum"> <variableExpression> <![CDATA[( $P{public_notes}.containsKey( $F{coverage_type_code} ) ? "<BR/>" + $P{public_notes}.get( $F{coverage_type_code} ) : "" )]]> </variableExpression> <initialValueExpression> <![CDATA[""]]> </initialValueExpression> </variable> With this expression the report does not work properly either: only the value from the last group is used (i.e. there is no string concatenation). Would I be correct in saying that's the case because calculation="Sum" can't apply to Strings? Or should that work, and I have something else wrong... (It would be great if I could avoid writing a scriptlet or making this any more complicated than it has to be). All the best, Dave Cherkassky.
  8. Full file attached (had to change the extension to allow upload) [file name=renewal.txt size=25287]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/renewal.txt[/file]
  9. I am using JasperReports 1.2.4 and iReport 1.2.4. I am trying to create a variable "public_notes" that is incremented every time the group "coverageTypeCode" changes. I have added such a variable using iReport, and this is what I got (added line breaks for formatting): Code:<variable name="public_notes" class="java.lang.String" resetType="Group" incrementType="Group" incrementGroup="coverageTypeCode" resetGroup="applicationId" calculation="Nothing"> <variableExpression> <![CDATA[$V{public_notes} + ( $P{public_notes}.containsKey( $F{coverage_type_code} ) ? ($V{public_notes}.length() > 0 ? "<BR/>" : "" ) + $P{public_notes}.get( $F{coverage_type_code} ) : "" )]]> </variableExpression> <initialValueExpression> <![CDATA[""]]> </initialValueExpression> </variable> I had assumed that since incrementType="Group" and incrementGroup="coverageTypeCode", the variableExpression would only be evaluated when the group changed. But I am finding that it is being evaluated with every record change instead. Am I missing something obvious? I am attaching the entire file for reference. Thanks, Dave Cherkassky DJiNN Software Inc.
  10. Attaching file (had to change extension to .txt). [file name=certificate.txt size=40872]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/certificate.txt[/file]
  11. Lucian, thanks for looking at this issue. Answers to your questions: >> You have printWhenGroupChanges="Coverage" set for your text field. Is this group changing when "NONE" gets repeated? No, this group does not change >> Could you try removing this and see whether the text still gets repeated? I tried this, no effect. >>Also, on which band is the text field placed? Is it on the detail band? Yes, the detail band. In this new forum, I can now attach the entire file. Thanks for your help, and sorry for the duplicate posts, Dave Cherkassky
  12. Greetings... I created the textField below: <textField isStretchWithOverflow="true" pattern="¤ #,##0" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Transparent" x="283" y="0" width="55" height="14" forecolor="#000000" backcolor="#FFFFFF" key="deductible" positionType="Float" isPrintRepeatedValues="false" printWhenGroupChanges="Coverage" isPrintWhenDetailOverflows="true"> <printWhenExpression><![CDATA[new Boolean( $F{application_type}.equals( "group" ) )]]></printWhenExpression> </reportElement> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Arial" pdfFontName="Helvetica" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{deductible} == null ? "NONE" : new DecimalFormat( "$ #####" ).format( $F{deductible} )]]></textFieldExpression> </textField> The key items to note are: - isPrintRepeatedValues="false" - <textFieldExpression class="java.lang.String"><![CDATA[$F{deductible} == null ? "NONE" : new DecimalFormat( "$ #####" ).format( $F{deductible} )]]></textFieldExpression> Even though, printing repeated values is false, the text "NONE" is repeated... I am using JasperReports 1.2.4, and the snippet above was created by iReport 1.2.4. Any suggestions? Thanks in advance, Dave Cherkassky VP of Software Development DJiNN Software Inc
×
×
  • Create New...