views:

182

answers:

2

I'm exporting a report to PDF using Crystal Reports bundled with VS2008. I need to display non-standard fractions so that they look nice instead of just something like 26/32. I have turned html interpretation on for the field so &frac12; and other standard html fraction entities display nicely, however, because CR does not understand <sup> and <sub> tags I cannot format non-standard fractions to look pretty. Anyone have any ideas?

** edit **

The fractions I'm displaying are passed to the Crystal Report as a string via a dataset in the format "xx/yy" or "xx yy/zz" and represent a product dimension. After thinking about it some more I could probably pass the numerator and the denominator as separate fields and format them in the report that way, but I'm hoping there's a more elegant way.

+2  A: 

I don't know if this will work, but I'll throw it out there anyway.

You can try to use inline styles instead of <sup> or <sub>. vertical-align allows a value of sub or super.

Example:

<td style="vertical-align:sub"> ... </td>

Hope this helps.

Dusty
I tried this out since Crystal does support some inline styling, but unfortunately CR doesn't respect the vertical-align. Didn't work when I adjusted margin or padding either. I did change the font size so the fraction looks better but still not perfect. Will keep experimenting with this line of thought. Thanks Dusty.
ren33
A: 

Look at my posting Crystal Reports: DecimalToFraction() Function

Craig