An Crystal Report server run in java.
- Copy fonts to
$JAVA_HOME/lib/fonts
, and set permission to this folder。sudo chmod -R $JAVA_HOME/lib/fonts 755
- Create fonts index, and update fonts cache。
- CentOS
yum install -y fontconfig mkfontscale mkfontscale && mkfontdir && fc-cache -fv
- Ubuntu
sudo apt-get -y install fontconfig xfonts-utils mkfontscale && mkfontdir && fc-cache -fv
- It contains
postgres
,mysql
,sql server
driver by default, Add your db driver inpom.xml
as necessary. - Config your database url, driverClassName, user, password in
application.properties
. - Run
maven package
to getwar
package. - Copy
war
to tomcat, copy crystal dependencylib
files toWEB-INF/lib
folder, and run tomcat. - Then copy your crystal report files to
WEB-INF/class/reports
folder, you can add them at anytime. - Open
http://server:port/Report/{ReportTemplateName}/{format}?param0=val0¶m1=val1
in browser, you can see your report. - If chinese text can't display in pdf, please configure /ect/locale.conf
LANG=zh_CN.UTF-8
Note:
{ReportTemplateName}
is the name of your report template file without extension,{format}
is the format you want, such asdoc
xls
,param0
andparam1
are the parameters of your report, give a param named withfilename
, this param value will be used as the file name. Suggestion: UsingCommand SQL
instead ofTable Link
for better performance, reduce the report generation duration.