Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Still in the Report Design Wizard, select from the menu at the top of the wizard File | Publish | To Location...
  2. 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.
  3. Next, modify the pentaho web application configuration files to include our connection info.
    1. Locate the web.xml file in <pci-home>\jboss\server\default\deploy\pentaho.war\WEB-INF.
    2. 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>

...

    1. 
          <description>mysql_db</description>

...

    1. 
          <res-ref-name>jdbc/mysql_db</res-ref-name>

...

    1. 
          <res-type>javax.sql.DataSource</res-type>

...

    1. 
          <res-auth>Container</res-auth>

...

    1. 
      </resource-ref>
      
    2. Locate the jboss-web.xml file in <pci-home>\jboss\server\default\deploy\pentaho.war\WEB-INF.
    3. 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>

...

    1. 
          <res-ref-name>jdbc/mysql_db</res-ref-name>

...

    1. 
          <res-type>javax.sql.DataSource</res-type>

...

    1. 
          <jndi-name>java:/mysql_db</jndi-name>

...

    1. 
      </resource-ref>
      
  1. Almost done! We need to create a datasource file for jboss to satisfy it's deployment requirements for recognizing our JNDI datasource.
    1. Create a file named mysql_db-ds.xml file in the <pci-home>\jboss\server\default\deploy directory.
    2. 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"?>

...

    1. {color}
          <datasources>
              <local-tx-datasource>

...

    1. 
                  <jndi-name>mysql_db</jndi-name>

...

    1. 
                  <connection-url>jdbc:mysql://localhost/sampledata</connection-url>

...

    1. 
                  <driver-class>com.mysql.jdbc.Driver</driver-class>

...

    1. 
                  <user-name>root</user-name>

...

    1. 
                  <password>password</password>
                  <metadata>
                      <type-mapping>mySQL</type-mapping>

...

    1. 
                  </metadata>
              </local-tx-datasource>

...

    1. 
          </datasources>
          ...
      
  1. Last, stop and restart the PCI. Run the PCI samples, and look for your new report under the Report Samples.