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

jzhao

Members
  • Posts

    6
  • Joined

  • Last visited

jzhao's Achievements

Rookie

Rookie (2/14)

  • First Post Rare
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hello, you helpful guys, My project is using ireport. Thanks for helping me solved some problems before. Here is another problem that I spent alot time try to solve it but without being solved. Please help!! Special French Characters (for example: é), the RTF format in window system is working fine for my reports, but not working if I switched to UNIX system. The problems are like this: all "é" caracters have been modified in "é". I tried swith from UTF-8 to ISO-8859-1 xml encoding, not working either. It may be a unix system configuration problem, but how to solve it?? Please help, Thanks very much.
  2. Hi, Lucian, I have tested in my application. It works very well only if the first row is not overflowing the frame/dummy group band. If both rows have fields overflowing the bands, the second rows will be lost. Actually, I have 12 row repeated data from database that need to put on a table report in three columns. Do not know in advance which row will have overflowing data. Of course if I set all the bands large enough to host the contains of the database fields, it will have no problem. but it looks lousy. Thank you very much, JZhao Post edited by: jzhao, at: 2006/12/05 06:03 Post edited by: jzhao, at: 2006/12/05 06:14
  3. Thanks, But there is still problem. If Don't set stretchType="RelativeToTallestObject" for any element, there are different height in a row. That is not acceptable in a report presented as a table. Hope there is a way to solve this problem. John lucianc wrote: You have a very funny understanding of the meaning of simple. Regarding your report: Don't set stretchType="RelativeToTallestObject" for any element. The elements in the second row need to be placed bellow the elements in the first row. In your case, you have y=0, height=12 in the first row and y=10 in the second row.[/ul] HTH, Lucian
  4. Thank you a lot, and please forgive me not here for a while since I was assigned to other projects. The jrxml code looks like this: ================================ <?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="test" 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"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <field name="ADDRESS_LINE_1" class="java.lang.String"/> <field name="ADDRESS_LINE_2" class="java.lang.String"/> <field name="CITY" class="java.lang.String"/> <field name="PROVINCE" class="java.lang.String"/> <field name="COUNTRY" class="java.lang.String"/> <field name="POSTAL" class="java.lang.String"/> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="32" isSplitAllowed="true" > <staticText> <reportElement x="0" y="9" width="95" height="23" key="staticText-1"/> <box topBorder="1Point" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[address]]></text> </staticText> <staticText> <reportElement x="94" y="9" width="161" height="23" key="staticText-2"/> <box topBorder="1Point" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[city]]></text> </staticText> <staticText> <reportElement x="255" y="9" width="93" height="23" key="staticText-3"/> <box topBorder="1Point" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[province]]></text> </staticText> <staticText> <reportElement x="348" y="9" width="93" height="23" key="staticText-4"/> <box topBorder="1Point" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[postal]]></text> </staticText> <staticText> <reportElement x="441" y="9" width="93" height="23" key="staticText-5"/> <box topBorder="1Point" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[country]]></text> </staticText> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="252" y="1" width="282" height="10" forecolor="#000000" key="textField-7"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Right" verticalAlignment="Middle"> <font fontName="Courier New" size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$V{PAGE_NUMBER} + " "]]></textFieldExpression> </textField> </band> </title> <pageHeader> <band height="10" isSplitAllowed="true" > <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="1" y="0" width="534" height="10" forecolor="#000000" key="textField-6" isRemoveLineWhenBlank="true"> <printWhenExpression><![CDATA[new Boolean( $V{PAGE_NUMBER}.intValue() !=1 )]]></printWhenExpression> </reportElement> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="1Point" bottomBorderColor="#000000"/> <textElement textAlignment="Right" verticalAlignment="Middle"> <font fontName="Courier New" size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$V{PAGE_NUMBER} + " "]]></textFieldExpression> </textField> </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="22" isSplitAllowed="true" > <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="94" y="0" width="161" height="12" key="textField-2" stretchType="RelativeToTallestObject"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{CITY}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="255" y="0" width="93" height="12" key="textField-3" stretchType="RelativeToTallestObject"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{PROVINCE}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="348" y="0" width="93" height="12" key="textField-4" stretchType="RelativeToTallestObject"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{POSTAL}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="441" y="0" width="93" height="12" key="textField-5" stretchType="RelativeToTallestObject"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{COUNTRY}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="95" height="12" key="textField-9" stretchType="RelativeToTallestObject"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{ADDRESS_LINE_1}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="10" width="95" height="12" key="textField-10" positionType="Float"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{ADDRESS_LINE_2}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="94" y="12" width="161" height="10" key="textField-11" positionType="Float"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["111"]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="255" y="12" width="93" height="10" key="textField-12" positionType="Float"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["222"]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="348" y="12" width="93" height="10" key="textField-13" positionType="Float"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["333"]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="441" y="12" width="93" height="10" key="textField-14" positionType="Float"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/> <textElement> <font size="8" pdfEncoding ="Cp1252"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["444"]]></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> Post edited by: jzhao, at: 2006/11/17 23:11
  5. Hi, Lucianc, Thanks a lot. It worked only if the second row without overflowing field, and the first row need to have stretchType set(otherwise only the field with overflowing content extended, other fields in this same row will not expended). The problem is: If second row also has field overflowing, say field2 in my first post, no matter how the stretchType set or not set, the contents in the overflowing field will not be shown(other fields in this same row will be shown). I also tried some other reports, the problem is general like this: in a report, if a second row/third row/... has mutiple fields and the positionType is set as float, and some of the fields have overflowing contents, then that field will not extend. Would you please give me idea? Thanks again. jzhao lucianc wrote: You only need to set isStretchWithOverflow for all text fields and positionType="Float" for the ones on the second row. Do not set any stretchType attribute. Also make sure that the elements on the second row start below the one on the first row (if they overlap with as few as 1 pixel, positionType="Float" would not work). HTH, Lucian
  6. Hi, I have a problem to align multiple fields if some of them have contents overflowing. eg. row1: field1 field3 field5 row2: field2 filed4 field6 These fields are popped from database with many records. some of them may have long contents that will possible overflow some fields, say, field1. So I set all the fields with "stretch with overflow" and stretch type = relativeToBandHeight or relativeToTollestObject. The results are not accecptable. Since row2 is not aligned with row1 well if row 1 overflowed(either overlaying or leaving space between). I also tried to set the Position Type to float. Not get good results. Please help!! Thanks
×
×
  • Create New...