JasperReports output format PDF issue

Questions and answers on developing, deploying and using plugins and JavaBeans

Re: JasperReports output format PDF issue

Postby mnaeimi » Mon Nov 18, 2019 4:55 pm

I updated the wiki page. https://www.servoyforge.net/projects/se ... Guidelines
Please let me know if you think we should add more stuff.
Mina @ Servoy
mnaeimi
 
Posts: 26
Joined: Fri Jun 08, 2012 2:48 pm

Re: JasperReports output format PDF issue

Postby tgs » Tue Nov 19, 2019 10:48 am

Hi Mina,

thank you for the Wiki update.

One more question:
While creating the font extension in jaspersoft studio you have to select the fonts(family) by source.
But the fonts direction is different on different OS. Does this matter if I choose the fonts from the OS source for the font extension?

I have putted the fonts to a folder in .../application_server/server/ROOT/reports/fonts and created the font extension from this source.
I have also copied this fonts folder to this direction on the production app server.

Do I have to do this?

Best regards
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby mnaeimi » Tue Nov 19, 2019 2:36 pm

Hi Thomas,

No, it doesn't mater, jar file doesn't have any reference to your local fonts.

After you add fonts to jasperreport studio and export them as a jar file, font_extension.jar (or any other name you give it ) file is created, this font_extension.jar is the only file you need to copy in <servoy_install_path>/application_server/plugins/servoy_jasperreports folder in your application server. Therefore you don't need to copy fonts folder.

Hope that helps. Let me know if you have any other questions.

Best regards,
Mina
Mina @ Servoy
mnaeimi
 
Posts: 26
Joined: Fri Jun 08, 2012 2:48 pm

Re: JasperReports output format PDF issue

Postby vik.lamp.vl » Tue Aug 08, 2023 11:08 am

Hi,
im pulling this thread up again.

I have a new project with Servoy TI. On my PC out of Servoy-Developer the Font Arial with Bold=true works (or better it worked last week, today not anymore lol)

But on the client-server it just doesnt work.
I had the Problem years ago with smart-client but it was a easy fix with the font.jar and JNLP edit. But how do we do it in the TI version on Tomcat?
In the Servoy-Exporter the, for example arial.jar wont show for export.
After the .war gets started on the server, it doesnt create a plugins/servoy-jasperreport folder etc.
I tried every solution i found online or had in mind. SansSerif and Arial both dont get to bold in the final PDF.


Anyone have a idea? I just cant get to work with TI (servoy 23.6, jasper-report 6.20.1).

Thanks!
vik.lamp.vl
 
Posts: 25
Joined: Wed May 26, 2021 3:37 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby mboegem » Tue Aug 08, 2023 1:09 pm

Hi Vik,

Either you have to make sure that the font is installed on the server (also installed/accessible to the account that is running tomcat)
OR
Like you mentioned export the font jar files so JasperReports are using them.

Developer is always a bit tricky, because the Jasper process is executed locally, being able to use the fonts which are installed on your machine, where in a deployed situation, all the Java code is able to use, is whatever is installed on the server it's running on.

Hope this helps.

BTW it doesn't make sense that Jasper plugin is not exported, unless you told the exporter not to.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: JasperReports output format PDF issue

Postby vik.lamp.vl » Tue Aug 08, 2023 5:25 pm

Hi Marc,

thanks. The Fonts are installed on the client-server. Both Arial and SansSerif are there. Im gonna check if the tomcat user can access them. But that shouldnt be a problem. Its the normal admin user.

What do you mean by "export the font jar files so jasperreports are using them" exactly?
Do you mean the .jar export from JasperStudio like discussed in this thread? If yes, in what folder do i place them in our tomcat-server\webapps\SOLUTION\... ?
For example: i tried to put the JasperStudio exported Arial.jar into our developer (application_server\plugins) folder. So that when we export the war, i can just export the Arial.jar within it. Didnt work :D
I also tried to place the Arial.jar into the reports folder where our reports are located on the client-server. Didnt work aswell.
I also tried to place it into tomcat\webapps\SOLUTION\META-INF\ (or WEB-INF).
I just cant find the right place to put it.


For the export: i guess i wrote it incorectly. I export the jasperplugin.jar with the war. It works fine, the reports are getting executed on the client-server.

What i meant is that, in older versions, where we shipped the servoy application server folder. There was a application_server\plugins\jasperreport folder. For smart-client solutions.
Now with TI and tomcat, when the .war gets unpacked by tomcat there is no \plugins\ folder. Only if we check the "enable Smart-client | RMI" option in the war-exporter. But we dont need that for TI, because no smart-client is used, only NG-Desktop Clients.

Tomorow i´m gonna check if the tomcat user has access rights to the installed fonts on the server.

I bet its something rly simple, that i just dont see!

Greetings
-Vik
vik.lamp.vl
 
Posts: 25
Joined: Wed May 26, 2021 3:37 pm
Location: Germany

Re: JasperReports output format PDF issue

Postby robert.edelmann » Tue Aug 08, 2023 6:56 pm

Hi Vic,

in NG or Ti you should include the fonts on the tomcat application server, the so the pdf-files that are created on the server include the correct fonts. It's not always enough to have the font installed on windows.

We had problems if the font is missing on the server in the server, even on systems including the fonts locally.

To install the font simply create the font-extension as discussed in this thread (described here https://community.jaspersoft.com/wiki/custom-font-font-extension)

To make the fonts accessible to the jasper-plugin copy the file in the plugin/servoy_jasperreports-folder in your developer, and modify the servoy_jasperreports.jar.jnlp to include the font_extension.jar.

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="%%serverURL%%" href="/servoy-client/plugins/servoy_jasperreports.jar.jnlp">
        <information>
                <title>Servoy Client Plugins</title>
                <vendor>Servoy and Others</vendor>
        </information>
        <resources>
                <j2se version="1.6+"/>
                <jar href="/plugins/servoy_jasperreports.jar" download="eager" version="%%version%%"/>
                <extension href="/plugins/servoy_jasperreports_commons.jar.jnlp" name="servoy_jasperreports_commons.jar" version="%%version%%"/>
<!-- svyExcelUtils libraries /-->
                <extension name="svy_utils_excel.jar" href="/plugins/poi/svy_utils_excel.jar.jnlp" version="%%version%%"/>
<!-- eigene Fonts /-->
                <jar href="/plugins/servoy_jasperreports/font_extension.jar" download="eager" version="%%version%%"/>
                <jar href="/plugins/servoy_jasperreports/jasperreports-6.19.1.jar" download="eager"/>
                <jar href="/plugins/servoy_jasperreports/commons-beanutils-1.9.4.jar" download="lazy" part="commons-beanutils" version="1.9.4"/>
                        <package name="org.apache.commons.beanutils.*" part="commons-beanutils" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/commons-collections-3.2.2.jar" download="lazy" part="commons-collections3" version="3.2.2"/>
                        <package name="org.apache.commons.collections.*" part="commons-collections3" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/commons-digester-2.1.jar" download="lazy" part="commons-digester" version="2.1"/>
                        <package name="org.apache.commons.digester.*" part="commons-digester" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/commons-logging-1.1.1.jar" download="lazy" part="commons-logging" version="1.1.1"/>
                        <package name="org.apache.commons.logging.*" part="commons-logging" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/groovy-3.0.7.jar" download="lazy" part="groovy" version="3.0.7"/>
                        <package name="org.codehaus.groovy.*" part="groovy" recursive="true"/>
                        <package name="groovy.*" part="groovy" recursive="true"/>
                        <package name="groovyjarjarantlr.*" part="groovy" recursive="true"/>
                        <package name="groovyjarjarasm.asm.*" part="groovy" recursive="true"/>
                        <package name="groovyjarjarcommonscli.*" part="groovy" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/ecj-3.21.0.jar" download="lazy" part="jdt-compiler" version="3.21.0"/>
                        <package name="org.eclipse.jdt.*" part="jdt-compiler" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/serializer-2.7.2.jar" download="lazy" part="serializer" version="2.7.2"/>
                        <package name="org.apache.xml.serializer.*" part="serializer" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/xalan-2.7.2.jar" download="lazy" part="xalan" version="2.7.2"/>
                        <package name="org.apache.*" part="xalan" recursive="true"/>
                        <package name="java_cup.runtime.*" part="xalan" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/xml-apis-1.4.01.jar" download="lazy" part="xml-apis" version="1.4.01"/>
                        <package name="javax.xml.*" part="xml-apis" recursive="true"/>
                        <package name="org.w3c.dom.*" part="xml-apis" recursive="true"/>
                        <package name="org.xml.sax.*" part="xml-apis" recursive="true"/>
                        <package name="org.apache.xmlcommons.Version" part="xml-apis" recursive="true"/>
                <jar href="/plugins/servoy_jasperreports/xml-apis-ext-1.3.04.jar" download="lazy" part="xml-apis-ext" version="1.3.04"/>
                        <package name="org.w3c.css.sac.*" part="xml-apis-ext" recursive="true"/>
                        <package name="org.w3c.dom.smil.*" part="xml-apis-ext" recursive="true"/>
                        <package name="org.w3c.dom.svg.*" part="xml-apis-ext" recursive="true"/>
        </resources>
        <component-desc></component-desc>
        <security>
                <all-permissions/>
        </security>
</jnlp>


Then build your WAR-File, and the fonts will be included, since the servoy_jasperreports.jar.jnlp gets parsed.

Can you check if after building the file is included? It should be under /WEB-INF/lib/font_extension.jar
mit freundlichen Grüßen
Robert Stefan Edelmann
User avatar
robert.edelmann
 
Posts: 91
Joined: Wed Aug 14, 2013 6:12 pm

Re: JasperReports output format PDF issue

Postby mboegem » Wed Aug 09, 2023 9:11 am

Hi Vik,

vik.lamp.vl wrote:What do you mean by "export the font jar files so jasperreports are using them" exactly?

Export the font from Jasper Studio as jar file.(font-extension)
I always put the files in the plugins/servoy_jasperreports folder

Once exported as war, you should see the file in [ROOT]/plugins/servoy_jasperreports folder as well

As far as I know (and experience) you don't have to change the jnlp file as described by Robert.
jnlp files are used by Java client (like smart client), but on the server the jar files will just be loaded.

Hope this helps
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: JasperReports output format PDF issue

Postby vik.lamp.vl » Wed Aug 09, 2023 10:29 am

Hi Robert,

thanks! Followed your advice and it worked!

So the .JNLP edit is necessary even for NG/TI Solutions, so that the font_extension.jar gets build/exported with the .war builder.
Good to know :)
vik.lamp.vl
 
Posts: 25
Joined: Wed May 26, 2021 3:37 pm
Location: Germany

Previous

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 5 guests