...
- Still in the Report Design Wizard, select from the menu at the top of the wizard File | Publish | To Location...
- Publish your report to <pci-home>\pentaho-solutions\samples\reporting. This will build a suitable action sequence for your report, and store all of the generated files in the solutions directory of the PCI.
- Next, modify the pentaho web application configuration files to include our connection info.
- Locate the web.xml file in <pci-home>\jboss\server\default\deploy\pentaho.war\WEB-INF.
- Inside the <webapp></webapp> tags, after the last </resource-ref> tag, add the following:
NOTE that the <res-ref-name> value should match the JNDI name used in the report definition above, preceded by "jdbc/".Code Block <resource-ref>
...
<description>mysql_db</description>
...
<res-ref-name>jdbc/mysql_db</res-ref-name>
...
<res-type>javax.sql.DataSource</res-type>
...
<res-auth>Container</res-auth>
...
</resource-ref>
- Locate the jboss-web.xml file in <pci-home>\jboss\server\default\deploy\pentaho.war\WEB-INF.
- Inside the <jboss-web></jboss-web> tags, after the last </resource-ref> tag, add the following:
NOTE that the <res-ref-name> value and the <jndi-name> value should include the JNDI name used in the report definition above.Code Block <resource-ref>
...
<res-ref-name>jdbc/mysql_db</res-ref-name>
...
<res-type>javax.sql.DataSource</res-type>
...
<jndi-name>java:/mysql_db</jndi-name>
...
</resource-ref>
- Almost done! We need to create a datasource file for jboss to satisfy it's deployment requirements for recognizing our JNDI datasource.
- Create a file named mysql_db-ds.xml file in the <pci-home>\jboss\server\default\deploy directory.
- Place the following XML in your newly created file, tweaked with the values specific to your database:
Code Block <?xml version="1.0" encoding="UTF-8"?>
...
{color} <datasources> <local-tx-datasource>
...
<jndi-name>mysql_db</jndi-name>
...
<connection-url>jdbc:mysql://localhost/sampledata</connection-url>
...
<driver-class>com.mysql.jdbc.Driver</driver-class>
...
<user-name>root</user-name>
...
<password>password</password> <metadata> <type-mapping>mySQL</type-mapping>
...
</metadata> </local-tx-datasource>
...
</datasources> ...
- Last, stop and restart the PCI. Run the PCI samples, and look for your new report under the Report Samples.