2004 IR Help Posted August 21, 2006 Share Posted August 21, 2006 By: Dave - program_user isStretchWhenOverflow="true" and TextFields 2005-01-28 14:51 Does anybody know if there is a maximum String length that can be displayed in a TextField when isStretchWhenOverflow="true". When I try to display long String (2200+ characters) in a TextField, it just keeps on going off the page instead of wrapping like it should (and does when the String is shorter). Any ideas? By: Dave - program_user RE: isStretchWhenOverflow="true" and TextFields 2005-02-02 13:33 The actual cut off is 2000. Any String length greater than 2000 causes this odd behavior. To clarify, a String of 2001 will extend past the width of its text field and continue of the page, so only one line is shown. If the String length is 2000 or less, it overflows to the next line like it should. This text field is in the detail section, isStretchWithOverflow="true", isPrintWhenDetailOverflows="true", and evaluationTime="Now". Any suggestions would be greatly appreciated. By: Dave - program_user RE: isStretchWhenOverflow="true" and TextFields 2005-02-02 11:25 Anyone? By: C-Box - c-box RE: isStretchWhenOverflow="true" and TextFiel 2005-02-02 22:54 I just tried out what you wrote, I put 2842 characters in a textfield... and voilá¥verything is printed as expected ... from the first char till the 2842th char. Also with a pagebreak. Do you work with DirectDataBaseConnection and a query or do you work with CustomDataSources? C-Box By: Dave - program_user RE: isStretchWhenOverflow="true" and TextFields 2005-02-03 07:32 Thanks C-Box for responding. I am using a Custom data source. It works well (page breaks and all) until the String being displayed reaches 2001+ characters. By: Dave - program_user RE: isStretchWhenOverflow="true" and TextFields 2005-02-03 09:10 C-Box, if you could, post your XML file so maybe I can see something I may have done differently. Thanks, program_user By: Dave - program_user RE: isStretchWhenOverflow="true" and TextFields 2005-02-04 07:27 Here's the textField that's having problems. <detail> <band height="49"> <textField isStretchWithOverflow="true" evaluationTime="Now"> <reportElement x="2" y="22" width="538" height="12" isRemoveLineWhenBlank="false" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Justified" verticalAlignment="Middle"> <font reportFont="Font_Normal" /> </textElement> <textFieldExpression class="java.lang.String"> $F{TextToDisplay} </textFieldExpression> </textField> </band> </detail> By: Dave - program_user RE: isStretchWhenOverflow="true" and TextFields 2005-02-04 21:26 Does this look OK? Anyone? By: Dave - program_user RE: isStretchWhenOverflow="true" and TextFields 2005-02-06 20:18 Has anyone been able to get past the 2000 character limit using the custom datasource? If so, what, if anything, did you need to do? By: C-Box - c-box RE: isStretchWhenOverflow="true" and TextFiel 2005-02-07 00:02 Well here is my code for a SubReport just showing ONE textfield. I put 3396 signs in it and EVERY CHARACTERS was shown (with one pagebreak even): <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="REP_SR_Pos_T" columnCount="1" printOrder="Vertical" orientation="Landscape" pageWidth="495" pageHeight="17" columnWidth="495" columnSpacing="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="2" /> <reportFont name="Arial_Normal" isDefault="false" fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="10" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Arial_BoldItalic" isDefault="false" fontName="Arial" size="10" isBold="true" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-BoldOblique" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Times_Normal" isDefault="false" fontName="Times New Roman" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Times-Roman" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Times_Bold" isDefault="false" fontName="Times New Roman" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Times-Bold" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Times_Italic" isDefault="false" fontName="Times New Roman" size="10" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Times-Italic" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Times_BoldItalic" isDefault="false" fontName="Times New Roman" size="10" isBold="true" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Times-BoldItalic" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Courier_Normal" isDefault="false" fontName="Courier New" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Courier" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Courier_Bold" isDefault="false" fontName="Courier New" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Courier-Bold" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Courier_Italic" isDefault="false" fontName="Courier New" size="10" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Courier-Oblique" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <reportFont name="Courier_BoldItalic" isDefault="false" fontName="Courier New" size="10" isBold="true" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Courier-BoldOblique" pdfEncoding="Cp1250" isPdfEmbedded="false"/> <field name="Id" class="java.lang.Integer"/> <field name="PosNr" class="java.lang.Integer"/> <field name="Langtext" class="java.lang.String"/> <field name="ZusatzText1" class="java.lang.String"/> <field name="ZusatzText2" class="java.lang.String"/> <field name="ZusatzText3" class="java.lang.String"/> <field name="ZusatzText4" class="java.lang.String"/> <field name="ZusatzText5" class="java.lang.String"/> <field name="ZusatzText6" class="java.lang.String"/> <field name="ZusatzText7" class="java.lang.String"/> <field name="ZusatzText8" class="java.lang.String"/> <field name="ZusatzText9" class="java.lang.String"/> <field name="ZusatzText10" class="java.lang.String"/> <background> <band height="0" isSplitAllowed="false" > </band> </background> <title> <band height="0" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="17" isSplitAllowed="true" > <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Opaque" x="35" y="0" width="376" height="15" forecolor="#000000" backcolor="#FFFFFF" key="element-45" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Arial" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{Langtext}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="0" isSplitAllowed="true" > </band> </summary> </jasperReport> So it MUST work... at your pos I'd debug my project and take a look at your CustomDataSource if there isn't the bug that cut your string after 2000 chars!??!?!??! Does your Sting contains any CRLF? I put 50 chars within one line and just copied all the lines again and again.... I try without any linebreaks within... wait....ok, without the CRLF's there are just 3259 characters within my string-field.... and IT WORKS..... everything is printed!!!!!!!!!!!!!!! hth C-Box By: Dave - program_user RE: isStretchWhenOverflow="true" and TextFiel 2005-05-27 11:30 This is only an issue when running on a MAC. Running on a PC doesn't have the 2000 character limit. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now