Jump to content
We've recently updated our Privacy Statement, available here ×

JasperReports and Websphere 6.0.0.1 on Linux


robertsv

Recommended Posts

Hello :)

 

I have a problem running Jasperreports on Websphere 6.0.0.1 (Linux). In windows there is no such problem.

By certain amount of the data blank lines are generated.

I tried to embed a font into a PDF document. If I check the document properties it looks that font is successfully embedded. But anyway the blank lines are generated! What could be the problem? Any ideas, solutions?

This is how I embed a font into a PDF document:

1)add propertie isPdfEmbedded ="true" to font tag and remove the property pdfFontName, fontName is "SansSerif".

Code:

<textElement textAlignment="Left">
<font fontName="SansSerif" size="8" isBold="true" isPdfEmbedded ="true"/>
</textElement>

 

2)in Java code:

 

Code:
[code]
// font map: java font -> pdf font
Map fontMap = new HashMap();
// normal font
fontMap.put(new FontKey("SansSerif", false, false), new PdfFont(fontFile, "Cp1252", true, false, false));
// bold font
fontMap.put(new FontKey("SansSerif", true, false), new PdfFont(fontFile.toString(), "Cp1252", true, true, false));
// italic font
fontMap.put(new FontKey("SansSerif", false, true), new pdfFont(fontFile.toString(), "Cp1252", true, false, true));
// bold and italic
fontMap.put(new FontKey("SansSerif", true, true), new PdfFont(fontFile.toString(), "Cp1252", true, true, true));
exporter.setParameter(JRExporterParameter.FONT_MAP, fontMap);

exporter.exportReport();
Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 months later...

Similar problem here.

 

I have read the FAQ and adding setting the linebreakpolicy property to true on report level(if i understand it right, this means putting it to the map like

Code:

model.put(JRPdfExporterParameter.FORCE_LINEBREAK_POLICY, true);

so maybe correct me if iam wrong.)

 

I think the big problem is here the IBM J9 VM and it's differences.

 

From another post i have taken your code and created a servlet what gives me a report page as a JPG back.

 

There it's a completely different font. but later the PDF generated by server has same font, but also doesnt show the text.

 

Iam stuck on this problem for very long time now. Iam glad if you could help.

Link to comment
Share on other sites

I think the problem is the font the Java AWT is using for the reports...

 

I do not understand/know how jasperreports is really compiling and working on the stuff, but as far as i understand it hangs together with the AWT.

 

So there are 2 possibilities.

 

not available font, because its a server so there arent a lot truetype fonts installed.

 

second a more specific problem within the IBM J9 VM and differences to the normal java ...

 

It's quite frustraiting this topic :(

Link to comment
Share on other sites

weeks of fighting around.

 

it's done..

 

added the missing font to the IBM J9 VM JRE folder...

 

 

AppServer/java/jre/lib/fonts

 

and its working. The jpg is looking fine now, so i guess the PDF will look good as well.

 

But can you a bit explain me how does Jasperreports works with the Java AWT ?? the normal explanation on the page doesn't help to fix such problem...and iam interested in this topic.

 

thanks. *happy*

finally weekend :D

Link to comment
Share on other sites

hehe well thanks, i have read it, but i must admit not carefully enough. I somehow read over the first part and thought that setting the linebreak policy would solve the problem. But hej I got it now.

So JR is only using the AWT for the fontName and measuring the text? I thought it's also using other components.

Your posts and support is helping really a lot, I want to thank you for all your work in here. Even i had to fight a lot with problems here and there(especially iReport and it's bugs here and there, are annoying). But Iam satisfied with the results :) this counts i think.

 

Once more thank you.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...