eaustin Posted March 4, 2011 Share Posted March 4, 2011 I'm attempting to style a textfieldexpression like so:(First code snippet)Exporting the data as XML results in: (Second code snippet) Keep in mind I only what the static text bolded.Any ideas as to what could going wrong? Mac 10.6Java 1.6Jasper 3.5.3Thanks in advance for any tips or help!Post Edited by eaustin at 03/04/2011 20:06Code:<!-- Style Template --><style name="parentStyle" isDefault="true" fontName="Arial" isBold="false" fontSize="13" pdfFontName="Helvetica"/><!-- Relevant Example --><textField isStretchWithOverflow="true"> <reportElement x="200" y="0" width="200" height="15" stretchType="RelativeToTallestObject"> <property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/> </reportElement> <box leftPadding="10"> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> </box> <textElement markup="html"> <font size="11"/> </textElement> <textFieldExpression><![CDATA[ "<b style='font-weight:bolder'>Account ID:</b><br/>" + $F{accountId} + "<br/><br/>" + "<b style='font-weight:bolder'>Email Address:</b><br/>" + $F{emailAddress} + "<br/><br/>" + "<b style='font-weight:bolder'>Status:</b><br/>" + $F{accountActiveStatus} + "<br/>" + $F{accountLockStatus} + "<br/><br/>" ]]></textFieldExpression> </textField><!-- XML Output --><text textHeight="177.08496" markup="html" lineSpacingFactor="1.1499023" leadingOffset="-2.3310547"> <reportElement x="200" y="0" width="200" height="212" origin="1"> <property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/> </reportElement> <box topPadding="3" leftPadding="10"> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> </box> <font size="11"/> <textContent><![CDATA[<style isBold="true">Account ID:</style>FIID#.loginId10<style isBold="true">Email Address:</style>10firstname_lastname@intuit.com<style isBold="true">Status:</style>DeactivatedUnLocked<style isBold="true">Last Login:</style>Fri Mar 04 15:19:50 EST 2011]]></textContent> </texPost Edited by eaustin at 03/04/2011 20:22 Link to comment Share on other sites More sharing options...
ldesaraju Posted March 4, 2011 Share Posted March 4, 2011 Text field style should say isBold = true and pdffontname should be 'Helvectica-Bold'. Each of the type of font has seperate ttf files I guess. I might be wrong but worth a try. Link to comment Share on other sites More sharing options...
maxio89 Posted November 26, 2013 Share Posted November 26, 2013 I had similar problem, in iReport preview was ok, but generated pdf had no any bold styles either font extension nor iReport/JasperReports library settings didn't help. In my case it was enough to add one extra dependency and it helped. There is a short description in below post: http://blog.itcrowd.pl/2013/11/bold-style-missing-in-jasperreports.html 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