Hi,
It is possible to set the html id using net.sf.jasperreports.export.html.id.
Is there any way to set the html class attribute in a similar way?
Magnus
1 Answer:
Magnus,
I haven't been on the JR forum to know if you discussed this topic there. But I just got the JR 4.0.1 release notification. It adds:
"custom property "net.sf.jasperreports.export.html.class" added at element level to allow
specifying the CSS "class" attribute for elements when exported to HTML and XHTML/CSS format;"
As far as I can tell, this is precisely what you're looking for.
Regards,
Matt
Thanks Matt!
You guys are really good at listening to feedback! Impressive.
Magnus
just tested .
you guys rock !
Hello,
Do we have any samples for this or some more documentation ?
Regards,
Bansi
Hi,
in practice, what you have to do is add <property name="net.sf.jasperreports.export.html.class" value="YOURVALUE"/> to the report element that you want, in HTML, to be of class="YOURVALUE".
Eg.
<reportElement x="157" y="0" width="15" height="78">
<property name="net.sf.jasperreports.export.html.class" value="verticaltext"/>
...
did you find any solution to it ? was actually looking for something like that ( set class element in HTML exported element )
Have you tried the JR forum yet? This probably needs to be broken into two pieces:
Point one should be on the JR forum. Point two would be here. (I don't know if it's possible. It sounds entirely reasonable, but I haven't heard of it being done before.)
Regards,
Matt
Hi,
1. As far as I know there is no such property yet. This list contains the id property but not a class property:
http://jasperreports.sourceforge.net/config.reference.html
2. I guess there is some kind of workaround by assigning the first part of the ID as static string: "useThisAsAClass"+$F{uniqueID}
And then use the static string part as a class. This is far from optimal though and it would certainly be nice with a class property.
Magnus
Post Edited by phantastes at 02/22/2011 19:23