Jump to content
JasperReports Library 7.0 is now available ×

Label and text


2005 IR Help

Recommended Posts

By: Manish Hatwalne - manish_hatwalne

Label and text

2004-03-30 20:53

I Have this problem -

In my report I have a label and associated text (field value) with it. The label (static text) is on LHS and the text (text field) is on RHS. The text may take up more space vertically (say 2 or 3 lines), wjhen text flows on the next line I want it to flow under the label, is it possible?

 

I'll try to elaborate it

 

Label - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

This is what happens now. And this is what I want -

 

Label - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

The only way I can think of doing this now is by including label as a string literal in my text field, but that means I cannot make lable bold, or keep it in diff color etc. Besides, that also means I cannot treat text field expression as anything but a String. Can't use formatting patterns etc.

 

How do I do this?

 

TIA,

- Manish

 

 

 

 

 

 

 

 

By: David Lim - aberrant80

RE: Label and text

2004-03-30 22:18

You can't easily. You need a hack.

 

First, you need to determine the length of your label, then insert as many spaces as needed in your text field to offset the starting position. Add the text field first then your label, so your label appears on top of the text field. Finally, export only to pdf because this won't work for excel or html.

 

But then, I'm not too sure this'll work either.

 

 

 

 

By: Manish Hatwalne - manish_hatwalne

RE: Label and text

2004-03-31 03:18

Thanks David, but it doesn't seem to be a prferrable approach.

 

BTW, the text didn' get formatted as I had wanted it to be. Th esecond line of text ("XXXXX"), starts where the lable Y co-ordinate ends.

 

Any other suggestion or idea?

 

Thanks,

- Manish

 

 

 

 

By: David Lim - aberrant80

RE: Label and text

2004-03-31 19:39

Nope. At the moment, JasperReports just doesn't support more than one formatting in each element.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...