kurt_cobain Posted May 7, 2008 Share Posted May 7, 2008 This seems simple, but I'm having a hard time figuring it out. I have a line like this: "This is [text field] just a test" The value of text field varies; it's a value from the database. I'd like to make it a certain size field, but if it's larger, "push" the rest of the sentence (i.e. 'just a test') over as needed. I've defined the position type as "float" and it still doesn't work. If I make the field too small, then its value gets "jumbled over" the string 'just a test'. If I make the field to big, I get something like this: "This is valueÂÂÂÂÂÂÂÂjust a test" I'd also like to make the text field left justified... thanksPost edited by: kurt_cobain, at: 2008/05/07 13:46 Link to comment Share on other sites More sharing options...
lucianc Posted May 7, 2008 Share Posted May 7, 2008 positionType="float" only pushes down/vertically a report element. There is no feature to push an element to the left, the positions of the elements on the horizontal axis are fixed. The only thing you can do is to combine the two texts into a single element, i.e. something likeCode:<textFieldExpression>$V{value} + " just a test"</textFieldExpression> Regards,Lucian Link to comment Share on other sites More sharing options...
kurt_cobain Posted May 8, 2008 Author Share Posted May 8, 2008 The reason that won't work is I need to make the text field bold and the text itself regular... unless there's a way to do that. As far as I can tell bolding, underlining etc only works with one "unit" and you can't mix within a unit such as a text field - can you? Another thing is, this field is actually a subreport that returns back a name based on a query and such..Post edited by: kurt_cobain, at: 2008/05/07 18:54 Link to comment Share on other sites More sharing options...
lucianc Posted May 8, 2008 Share Posted May 8, 2008 kurt_cobain wrote:The reason that won't work is I need to make the text field bold and the text itself regular... unless there's a way to do that. As far as I can tell bolding, underlining etc only works with one "unit" and you can't mix within a unit such as a text field - can you? You can, using styled text. See the "styledtext" JasperReports sample. Another thing is, this field is actually a subreport that returns back a name based on a query and such.. If the text field itself is in the subreport, there's no solution for this. But if the String value is returned from a (possibly empty) subreport, you can still use styled text to display the value in the master report. Regards,Lucian 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