dakosha Posted August 23, 2009 Share Posted August 23, 2009 Hi every one...I got some problem.I'm trying to create a table and there are some text which has alot of symbols, in HTML table element makes TableRow Height in automation manner. So, the question is : how to make it possible to set TextFiled or StaticText in JasperReports in the same manner. Cause when I got the length of text more than one row, the next row is hidden in the same field of table. Could anyone help me to solve this problem? In exmaple which I attached below, you can see that the test "DAKOSHA" couldn't be read; How to set the auto-height attribute for this StaticText?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="report6" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"/> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="61" splitType="Stretch"/> </columnHeader> <detail> <band height="125" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="555" height="43"/> <textElement> <font size="48"/> </textElement> <text><![CDATA[DAKOSHA]]></text> </staticText> </band> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="54" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport> Link to comment Share on other sites More sharing options...
sohbati Posted August 24, 2009 Share Posted August 24, 2009 try this : it may help you.Code: JRDesignTextField tf = new JRDesignTextField(); tf.setStretchWithOverflow(true); tf.setStretchType(JRTextElement.STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT); Link to comment Share on other sites More sharing options...
dakosha Posted August 24, 2009 Author Share Posted August 24, 2009 Thanks, I'll try... Can I set that attributes in JRXML. I mean, is there some tags or something whcih are the same as java code; Cause, I wanna use already compiled jasper report file. Link to comment Share on other sites More sharing options...
Teodor Danciu Posted August 24, 2009 Share Posted August 24, 2009 Hi, Yes, there are such alternatives.Actually, what sohbati suggested you was to replace the static text element with a text field element (backed by expression) and leverage its isStretchWithOverflow property and stretchType property (I'd say the second one is optional). I hope this helps,Teodor 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