Unable to export to PDF (fix)
- 1 Issue Description
- 2 Fix #1: Fonts used in the report not included in the JDK
- 3 Fix #2: A windows update reverting the fonts to an out-dated version
- 4 Fix #3: Design Alternatives are not enabled, and the exporter expects a design alt value
- 5 Fix #4: Elevate Tomcat log on user to have better priviledges
Issue Description
When exporting a crystal report in cableBuilder, you may get an error:
It may also appear in the logs as:
This can be caused by one of four issues:
The fonts used in the report not being included in the JDK.
A Windows update, specifically KB3102429, which reverts the fonts back to an out-dated version
Design Alternatives are not enabled, and the exporter expects a design alt value.
Tomcat service does not have the ability to open fonts
Fix #1: Fonts used in the report not included in the JDK
To fix this, follow these steps:
Create a fonts folder -> %JAVA_HOME%/lib/fonts
Copy fonts from 'C:\\Windows\Fonts' into %JAVA_HOME%/lib/fonts.
I think the problem is that newer JDK versions are not shipped with a lib/fonts folder which the Crystal Report engine expects.
Fix #2: A windows update reverting the fonts to an out-dated version
See the following image:
In my case, following fix #1 resolved the issue.
Fix #3: Design Alternatives are not enabled, and the exporter expects a design alt value
The fix is to edit the crystalReportExporter.jsp
file and update the code where it tries getting designAlternative, and change it to version. Restart the tomcat service and try again, it should now work.
This is only required if “Enable Design Alternatives”
is disabled in System Parameters
in Base Data
crystalReportExporter.jsp
is located in the Crystal Reports home install directory
Example, before, note the arrow referencing the “designAlternative” variable on line 48 and associated parameter names:
After, the above example has been replaced with “version” for all design alternative references:
Fix #4: Elevate Tomcat log on user to have better priviledges
Sometimes Tomcat may not have suitable base priviledges to interact with some folders or files on the system.
Change the type from “Local Service Account”
(Default) to “Local System Account”
and tick the “Allow service to interact with desktop”
.
This will allow the system to interact with files as a user.