为什么用开源报表系统?http://reporting.pentaho.com/
做好配置数据源后不需要做代码的开发就可以展示各种报表
http://www.pentaho.com/download/这个用的是企业版,证书过期了,只能系统重装,再试用30天吧,推荐使用社区版
pentaho 是世界上最流行的开源商务智能软件。它是一个基于 java 平台的商业智能 (Business Intelligence,BI) 套件,之所以说是套件是因为它包括一个 web server 平台和几个工具软件:报表,分析,图表,数据集成,数据挖掘等,可以说包括了商务智能的方方面面。Pentaho 是跨平台的, linux,windows 上都可以安装,而且安装十分简单,就两个步骤:解压,执行。
增加CATALINA_OPTS环境变量,让Apache-Tomcat服务器能使用比默认值更多的内存
CATALINA_OPTS= Dsun.rmi.dgc.server.gcInterval=3600000
配置jdk环境变量
PATH = C:\Program Files (x86)\Java\jdk1.6.0_05\bin;C:\Program Files (x86)\Java\jdk1.6.0_05\jre\bin;C:\Program Files\Java\jdk1.6.0_05 JAVA_HOME = C:\Program Files (x86)\Java\jdk1.6.0_05 CLASSPATH = C:\Program Files (x86)\Java\jdk1.6.0_05\lib\tools.jar
bi-server平台是一个基于tomcat的JSP web 程序,包含两个界面:user console和administration console,分别对应的是用户控制台和管理控制台。其作用如下:
用户控制台:供用户登录进去对数据进行操作,如报表,分析等。localhost:8080
管理控制台:供管理员进去对用户,数据源(Data source),BI server等做全局设置。localhost:8099
创建样例数据库 (样例不报错)
进入mysql控制台,导入sql命令:顺序如下:
source E:\BI\pentaho\biserver-ce\data\mysql5\create_repository_mysql.sql source E:\BI\pentaho\biserver-ce\data\mysql5\create_quartz_mysql.sql source E:\BI\pentaho\biserver-ce\data\mysql5\load_sample_users_mysql.sql source E:\BI\pentaho\biserver-ce\data\mysql5\migration.sql
jdbc.driver=org.hsqldb.jdbcDriver jdbc.url=jdbc:hsqldb:hsql://localhost:9001/hibernate jdbc.username=hibuser jdbc.password=password hibernate.dialect=org.hibernate.dialect.HSQLDialect改成:
jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/hibernate jdbc.username=hibuser jdbc.password=password hibernate.dialect=org.hibernate.dialect.MySQLDialectB、将biserver-ce\pentaho-solutions\system\applicationContext-spring-security-jdbc.xml
<!-- This is only for Hypersonic. Please update this section for any other database you are using --> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="org.hsqldb.jdbcDriver" /> <property name="url" value="jdbc:hsqldb:hsql://localhost:9001/hibernate" /> <property name="username" value="hibuser" /> <property name="password" value="password" /> </bean>将高亮部分替换为:
..................... <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/hibernate" /> <property name="username" value="hibuser" /> <property name="password" value="password"/> </bean>
<property name="connection.username">hibuser</property> <property name="connection.password">password</property>biserver-ce\pentaho-solutions\bi-developers\datasources下的HQL_Datasource_MySQL.cfg.xml也要修改用户名密码
<property name="connection.username">hibuser</property> <property name="connection.password">password</property>
<config-file>system/hibernate/hsql.hibernate.cfg.xml</config-file>改成:
<config-file>system/hibernate/mysql5.hibernate.cfg.xml</config-file>配置 Hibernate和Quartz
<?xml version="1.0" encoding="UTF-8"?> <Context path="/pentaho" docbase="webapps/pentaho/"> <Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5" maxWait="10000" username="hibuser" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/hibernate" validationQuery="select 1" /> <Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5" maxWait="10000" username="pentaho_user" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/quartz" validationQuery="select 1"/> </Context>
<context-param> <param-name>solution-path</param-name> <param-value></param-value> </context-param>根据你的安装情况,进行相关参数配置改为
<context-param> <param-name>solution-path</param-name> <param-value>yourpath\to\biserver-ce\pentaho-solutions</param-value> </context-param>URL找到下面这段代码:
<param-value>http://localhost:8080/pentaho/</param-value>修改样例(根据你的电脑或服务器的域名或IP地址修改):
<param-value>http://www.prashantraju.com:8080/pentaho/</param-value> <!-- or --> <param-value>http://192.168.1.10:8080/pentaho/</param-value>
<publisher-config> <publisher-password></publisher-password> </publisher-config>修改样例(以后,要把内容发布到Pentaho BI平台,就需要下面设置的密码了):
<publisher-config> <publisher-password>password</publisher-password> </publisher-config>
DEBUG: Using JAVA_HOME DEBUG: _PENTAHO_JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_05 DEBUG: _PENTAHO_JAVA=C:\Program Files (x86)\Java\jdk1.6.0_05\bin\java.exe 17:28:48,762 INFO [JettyServer] Console is starting 17:28:48,786 INFO [/] org.pentaho.pac.server.BrowserLocaleServlet-1259414: init 17:28:48,786 INFO [/] org.pentaho.pac.server.DefaultConsoleServlet-16416372: in it 17:28:48,786 INFO [/] org.pentaho.pac.server.PacServiceImpl-6609937: init 17:28:48,787 INFO [/] org.pentaho.pac.server.SchedulerServiceImpl-32481053: ini t 17:28:48,787 INFO [/] org.pentaho.pac.server.SolutionRepositoryServiceImpl-5256 233: init 17:28:48,787 INFO [/] org.pentaho.pac.server.SubscriptionServiceImpl-24669796: init 17:28:48,787 INFO [/] org.pentaho.pac.server.common.HibernateConfigurationServi ceImpl-1012673: init 17:28:48,787 INFO [/] org.pentaho.pac.server.common.JdbcDriverDiscoveryServiceI mpl-32960703: init 17:28:48,797 INFO [JettyServer] Console is now started. It can be accessed usin g http://admin-PC:8099 or http://192.168.1.123:8099