How should I include √E in html? problem is I want the sign completely over E. which is not coming. please do help
-
what does this have to do with jasper reports? and how do you tell it to "stop" at just the E? What if E were another formula instead of a single character? – Andrew Barber Jul 06 '12 at 06:38
-
Thanks Andrew.:actually i am embedding a formula in pdf through i report using html tags. i.e. ÝA; in unicode for square root. but it is not covering the letter E.. – Shreyas Deshpande Jul 06 '12 at 06:41
-
@AndrewBarber, the question on stopping would be better as "do you want it to stop" instead of "how to stop" because the latter overlaps with the original question; the latter would be perhaps more suitable as an edit to the question than a comment (after the author confirms it is his intent). – n611x007 Jul 06 '12 at 06:42
-
some html examples http://www.scientificpsychic.com/etc/square-root.html similar/same technique to Ilmo Euro's. search keywords I used were `square root over html` – n611x007 Jul 06 '12 at 06:49
-
I dont know about it.. will it be used in html tag? because i have sent many of the fieds through properties file and use html tag whenever there is formula. – Shreyas Deshpande Jul 06 '12 at 06:50
-
LaTeX is not directly embeddable in html (afaik) but if the html rendering engine supports it you could also use http://www.mathjax.org/ or MathML. – n611x007 Jul 06 '12 at 06:55
-
if `count of similar cases` is low then just use the css solution. For lot's of formulas + pretty math it would be better to invest time to investigate mathjax as a possibility or switch to a latex->pdf solution. I'm no expert though, it just seems logical this way. – n611x007 Jul 06 '12 at 06:58
-
@Ilmo Euro how should i include the css inside the static text? because i think that th code √ E will work.. but dont know how to use it in my static text field? – Shreyas Deshpande Jul 06 '12 at 08:22
-
@ShreyasDeshpande I guess topPen is your best bet in staticText: define the topPen for the E in a – Ilmo Euro Jul 06 '12 at 08:42
-
@Ilmo Euro: I have included the following code. its is getting printed correctly in browser if we run thids html file directly on browser. but for the jasper it doesnt. is therre any setting in ireport? plz help..! Code is:-
FWHM=0.921 + 0.039 * √ E – Shreyas Deshpande Jul 06 '12 at 11:55 -
@ShreyasDeshpande CSS is not supported as far as I know, but you can achieve the same effect with iReport's "padding and borders" functionality. See this: http://stackoverflow.com/questions/10278067/adding-table-border-in-jasperreports – Ilmo Euro Jul 06 '12 at 12:00
-
@IlmoEuro: Yeppie..! Finally i got it..! Actually my formila is FWHM=0.921+0.039*√E. I have splitted the formula into three parts 1st is FWHM=0.921+0.039* 2nd is √ and 3rd is E. I have creted the style tag or object like then i have added this object to my static fields property... and setted vertical alignment as middle for E... then just a matter of adjustments in ireport. thanks to everyone.. Thanks Ilmo Euro – Shreyas Deshpande Jul 09 '12 at 12:12
4 Answers
You can use CSS text-decoration:overline
:
√<span style="text-decoration:overline;">E</span>
Or define a "overline" class with text-decoration:overline
and:
√<span class="overline">E</span>
This won't work with complex formulas, though.
If CSS is not supported (in Jasper Reports, for example), the Unicode character for overline can be used:
√E̅
Sometimes the fonts have to be adjusted with this approach, though.

- 4,925
- 1
- 27
- 29
-
-
-
@ShreyasDeshpande I modified the answer to include non-CSS alternative. – Ilmo Euro Jul 09 '12 at 06:14
-
Yeppie..! Finally i got it..! Actually my formila is FWHM=0.921+0.039*√E. I have splitted the formula into three parts 1st is FWHM=0.921+0.039* 2nd is √ and 3rd is E. I have creted the style tag or object like then i have added this object to my static fields property... and setted vertical alignment as middle for E... then just a matter of adjustments in ireport. thanks to everyone.. Thanks Ilmo Euro – Shreyas Deshpande Jul 09 '12 at 11:33
This might be overkill for your scenario, but check out MathJax, which is used on math.stackexchange.com.

- 52,939
- 59
- 191
- 278
This page give an excellent example how you can apply Ilmo's solution to complex formulas

- 9,126
- 7
- 34
- 61
I finally solved it. Actually my formula is FWHM=0.921+0.039*√E. I have split the formula into three parts:
- FWHM=0.921+0.039*
- √
- E
I have creted the style tag or object like
<style name="table_TH" mode="Opaque" backcolor="#FFFFFF"> <box> <topPen lineWidth="1.5" lineColor="#000000"/> </box> </style>
Then I have added this object to my static fields property and set vertical alignment as middle for E. Then it is just a matter of adjustments in ireport. Thanks to everyone for the help.

- 70,661
- 34
- 192
- 269

- 139
- 1
- 11