How to draw border to a textfield

0

Hello every one,

I want to add a border to a textfield, but I don't want to use a rectangle arround it, is there any way I can do it?

I found an attribute pen="Thin" but I can't make it work.

Please, can anyone help me?

Thanks

dgiulian's picture
104
Joined: Jul 2 2009 - 9:56am
Last seen: 3 years 10 months ago

4 Answers:

5

Thanks for your reply, but I've  found a way to do it using iReport. I'll explain it so if anyone has the same problem can solve it.

Select the text field and right click, In the context menu select padding and borders and assign a non zero value  to the line width.

Thanks again for your reply.

dgiulian's picture
104
Joined: Jul 2 2009 - 9:56am
Last seen: 3 years 10 months ago

Thanks, it helped me

jojobojo379 - 5 years 1 day ago

This helped my issue...Thank you very much...

poornima.alex - 4 years 8 months ago

Thanks, it really saved my day

izafa.g.w.khan - 1 year 5 months ago
0

hi dgiulian,

 

Please check out the code, you wrote that the pen stuff is not working with u, but this should work fine.

If it doesn't work then use 4 lines around the textfield, but this may give u problem when the text field is stretched dynamically. Just try out once.

 

Thanks.

Code:
			<textField>
				<reportElement x="291" y="0" width="128" height="20"/>
				<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<leftPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
					<rightPen lineWidth="0.5" lineStyle="Solid"/>
				</box>
				<textElement textAlignment="Center">
					<font size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$F{eid}]]></textFieldExpression>
			</textField></td></tr></tbody></table>
k1234's picture
36
Joined: Jan 23 2009 - 12:25am
Last seen: 10 years 4 months ago
0

Thanks for your reply

I tried that code, and it worked but now the box cover the text, so I can't see the values of the textfield, How can I make it transparent?

Another thing, is there any way I can do it using iReport?

Again, Thanks

dgiulian's picture
104
Joined: Jul 2 2009 - 9:56am
Last seen: 3 years 10 months ago
0

Can u attach the jrxml file,  i am not clear about your problem in report.



Post Edited by k1234 at 07/24/2009 06:22
k1234's picture
36
Joined: Jan 23 2009 - 12:25am
Last seen: 10 years 4 months ago
Feedback