Nicholas DiPiazza
Nicholas DiPiazza

Reputation: 10585

Jasper Reports - How to get JRXML components with mixed styles or dynamic widths on text boxes?

When buliding jasper reports JRXML files I want to be able to have a row of dynamically width'd text boxes of mixing styles. It does not seem like Jasper supports that so I'm stuck with this:

enter image description here

Notice how I used two static text boxes for this display with fixed widths. This is because I cannot mix the bold + normal font styles inside a component.

I would rather something like this:

enter image description here

Where the NOW() and $P{name} will automatically stretch out and look real nice.

Note: I cannot use the HTML component due to this issue http://community.jaspersoft.com/questions/540569/html-component-font and https://community.jaspersoft.com/jasperreports-library/issues/4411-0

Is there a way to code JRXML files with dynamically width'd Textboxes?

Upvotes: 0

Views: 664

Answers (1)

soylentgreen81
soylentgreen81

Reputation: 76

Actually, you can mix styles using markup in a single text box. Jasper supports (simple) HTML, RTF and a custom jasper-styling.

Check the "markup" property.

But I am not aware that you could insert artificial borders around the values when using a single textbox.

Upvotes: 1

Related Questions