2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: Greg Greaves - ggreaves Long text field truncated 2003-08-20 15:47 I have a long text field (approx. 8K) that is getting truncated after 255 bytes. Any idea why this might be happening? Here's the definition of the field in question: <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Group" evaluationGroup="MemoGroup" hyperlinkType="None" > <reportElement mode="Transparent" x="180" y="19" width="314" height="15" forecolor="#000000" backcolor="#FFFFFF" positionType="Float" isPrintRepeatedValues="true" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" verticalAlignment="Middle" lineSpacing="Single"> <font fontName="Times-Roman" pdfFontName="Times-Roman" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{M_MEMO}</textFieldExpression> </textField> By: Sohan Kasula - skasula RE: Long text field truncated 2003-08-21 08:50 Everything looks fine except for one thing, isPrintWhenDetailOverflows, set this to true. If the data is spilled over to the next page then this is required to be true. Other thing to look at is the source of the data field. if it is a SQL string then check the SQL settings. hope this helps. By: Greg Greaves - ggreaves RE: Long text field truncated 2003-08-21 11:22 I have tried isPrintWhenDetailOverflows set to true and the same thing happens. I'm running the report from within iReport so I suppose there is a possibility it's truncating the sql. When I run the report from outside iReport, the field doesn't stretch Is there something in the definition of the textfield that would keep it from stretching? -Greg By: Greg Greaves - ggreaves RE: Long text field truncated 2003-08-21 11:45 Ok, I elminated iReports from the equation and got (I think) the simplest example that demonstrates the problem. The field is truncated after 255 characters even though it's 8k big. XML for the report definition follows: <?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="Untitled_report_2" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <queryString><![CDATA[select ID, SUBJECT, MEMO from T_MEMO]]></queryString> <field name="ID" class="java.lang.Integer"/> <field name="SUBJECT" class="java.lang.String"/> <field name="MEMO" class="java.lang.String"/> <background> <band height="8"> </band> </background> <title> <band height="8"> </band> </title> <pageHeader> <band height="9"> </band> </pageHeader> <columnHeader> <band height="5"> </band> </columnHeader> <detail> <band height="35"> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="18" y="11" width="459" height="20" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Left" verticalAlignment="Top" lineSpacing="Single"> <font fontName="sansserif" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{MEMO}</textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="9"> </band> </columnFooter> <pageFooter> <band height="11"> </band> </pageFooter> <summary> <band height="8"> </band> </summary> </jasperReport> Any idea what is causing this? Has anybody successfully printed really long text fields? -Greg By: Sohan Kasula - skasula RE: Long text field truncated 2003-08-21 13:12 I tested your xml file and was able to print over 300 characters successfully. I think it's sql string that is not returning the complete string. Try getting the length of the returned value in the sql environment and see. By: Greg Greaves - ggreaves RE: Long text field truncated 2003-08-22 07:13 Thanks for your help. I checked my application server's URL for the jdbc connection (to Sybase) and saw that it was using a connection parameter (JCONNECT_VERSION=6) that I wasn't supplying. Once I did this then the long strings come back fine. 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