Author: mcaspers
Date: 2011-03-08 19:40:13 -0500 (Tue, 08 Mar 2011)
New Revision: 29635
Modified:
trunk/birt/docs/en-US/Revision_History.xml
trunk/birt/docs/en-US/birt_reports_deployment.xml
trunk/birt/docs/en-US/framework.xml
trunk/birt/docs/en-US/links.xml
Log:
"General editing and screenshot updates"
Modified: trunk/birt/docs/en-US/Revision_History.xml
===================================================================
--- trunk/birt/docs/en-US/Revision_History.xml 2011-03-08 23:40:12 UTC (rev 29634)
+++ trunk/birt/docs/en-US/Revision_History.xml 2011-03-09 00:40:13 UTC (rev 29635)
@@ -5,7 +5,21 @@
<simpara>
<revhistory>
<revision>
- <revnumber>0.0</revnumber>
+ <revnumber>0-1</revnumber>
+ <date>Wed Mar 09 2011</date>
+ <author>
+ <firstname>Matthew</firstname>
+ <surname>Casperson</surname>
+ <email>mcaspers(a)redhat.com</email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Screenshot updates, general editing, and procedure
review.</member>
+ </simplelist>
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>0-0</revnumber>
<date>Thu Nov 22 2010</date>
<author>
<firstname>Isaac</firstname>
Modified: trunk/birt/docs/en-US/birt_reports_deployment.xml
===================================================================
--- trunk/birt/docs/en-US/birt_reports_deployment.xml 2011-03-08 23:40:12 UTC (rev 29634)
+++ trunk/birt/docs/en-US/birt_reports_deployment.xml 2011-03-09 00:40:13 UTC (rev 29635)
@@ -3,19 +3,52 @@
<title>Creating a Dynamic BIRT Report</title>
<para>
- <xref linkend="birt_integration_with_seam"/> and <xref
linkend="hibernate_datasource"/> describe how to integrate a BIRT report into
a Seam web project and how to use Hibernate data source to generate a dynamic report. In
this section we will create a Seam web project that can make a dynamic report using the
parameters that are defined on a web page.
+ <xref linkend="birt_integration_with_seam"/> and <xref
linkend="hibernate_datasource"/> describe how to integrate a BIRT report into
a Seam web project and how to use a Hibernate data source to generate a dynamic report. In
this section we will create a Seam web project that can make a dynamic report using the
parameters that are defined on a web page.
</para>
<para>
- We will use the <emphasis>PRODUCTS</emphasis> table of
<emphasis>DATAMODELS</emphasis> database for the purpose of this demo project.
The demo application will generate a report about the company's products, and allow
the user to specify a product line. To begin with, we need to generate Seam entities like
we did in the previous <xref linkend="hibernate_datasource"/>.
+ We will use the <emphasis>PRODUCTS</emphasis> table of
<emphasis>Classic Models Inc. Sample Database</emphasis> for the purpose of
this demo project. The demo application will generate a report about the company's
products, and allow the user to specify how the report will be sorted. To begin with, we
need to generate Seam entities like we did in the previous <xref
linkend="birt_integration_with_seam"/>.
</para>
<orderedlist>
<listitem>
<para>
- The next step is to create a Java class that will store the
<code>sortOrder</code> variable and its assessors, and register the class in
the <filename>faces.config.xml</filename> file. The variable will be required
to pass dynamic data to the report via report parameters; therefore it has to be of
session scope.
+ The next step is to create a Java class that will store the
<code>sortOrder</code> variable and its assessors. The variable will be
required to pass dynamic data to the report via report parameters; therefore it has to be
of session scope.
</para>
+ <para>
+ The code below shows a simple JavaBean class called
<code>ReportJB</code>.
+ </para>
+ <programlisting role="Java">
+import java.io.Serializable;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("ReportJB")
+(a)Scope(ScopeType.SESSION)
+public class ReportJB implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ protected String sortOrder = "buyprice";
+
+ public String getSortOrder()
+ {
+ return sortOrder;
+ }
+
+ public void setSortOrder(String value)
+ {
+ sortOrder = value;
+ }
+
+ public ReportJB()
+ {
+
+ }
+}
+</programlisting>
</listitem>
<listitem>
@@ -24,7 +57,7 @@
</para>
<para>
- The data set should have at least the following data set items: product vendor,
product name, quantity in stock and buy price. The data is retrieved from the
<guilabel>Classic Models Inc. Sample Database</guilabel> with this query :
+ The data set should have at least the following data set items: product vendor,
product name, quantity in stock and buy price. The data is retrieved from the database
with this query :
</para>
@@ -35,7 +68,7 @@
<para>Make a table in the report and put each data set item into a
column.</para>
</listitem>
<listitem>
- <para>As it was stated in the beginning of the chapter the report will be
dynamic, therefore you need to declare a report parameter first, let it be
<code>sortOrder</code> and to add the parameter to the query.
+ <para>As it was stated in the beginning of the chapter the report will be
dynamic, therefore you need to declare a report parameter first. Call this parameter
<code>sortOrder</code> and to add the parameter to the query.
</para>
<figure>
<title>Report Parameter</title>
@@ -46,63 +79,27 @@
</mediaobject>
</figure>
<para>
- BIRT offers rich JavaScript API, so you can modify the query programmatically like
this:</para>
+ BIRT offers rich JavaScript API, so you can modify the query programmatically like
this (the <code>xml-property</code> tag shown below should already be present
in the report):</para>
<programlisting role="XML">
-
-<xml-property name="queryText"><![CDATA[
-SELECT productvedor,
-productname,
-quantityinstock,
-buyprice
-FROM Products as products
-]]></xml-property>
- <method name="beforeOpen"><![CDATA[
+<xml-property name="queryText"><
+![CDATA[
+SELECT productvendor, productname, quantityinstock, buyprice
+FROM CLASSICMODELS.PRODUCTS as products
+]]>
+</xml-property>
+<method name="beforeOpen">
+<![CDATA[
queryString = " ORDER BY
products."+reportContext.getParameterValue("sortOrder")+"
"+"DESC";
this.queryText = this.queryText+queryString;
-]]></method>
-
+]]>
+</method>
</programlisting>
</listitem>
<listitem>
<para>The report is ready. You can preview it to make sure it works properly.
</para>
</listitem>
<listitem>
- <para>
- Create a JavaBean class called <code>ReportJB</code>, and populate it
with the following code.
- </para>
- <programlisting role="Java">
-import java.io.Serializable;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
-@Name("ReportJB")
-(a)Scope(ScopeType.SESSION)
-public class ReportJB implements Serializable
-{
- private static final long serialVersionUID = 1L;
- protected String sortOrder = "buyprice";
-
- public String getSortOrder()
- {
- return sortOrder;
- }
-
- public void setSortOrder(String value)
- {
- sortOrder = value;
- }
-
- public ReportJB()
- {
-
- }
-}
-</programlisting>
- </listitem>
- <listitem>
- <para>To set the report parameter you should create an
<filename>XHTML</filename> view page, call it
<filename>ProductForm.xhtml</filename>, and place it in the
<filename>WebContent</filename> folder. On the page you can set the value of
the <code>sortOrder</code> Java bean variable and press the
<guibutton>Generate Report</guibutton> button to open another view page that
will display the resulted report.
+ <para>To set the report parameter you should create an
<filename>XHTML</filename> page, call it
<filename>ProductForm.xhtml</filename>, and place it in the
<filename>WebContent</filename> folder. On the page you can set the value of
the <code>sortOrder</code> Java bean variable and click the
<guibutton>Generate Report</guibutton> button to open another view page that
will display the resulted report.
</para>
@@ -110,34 +107,35 @@
<programlisting role="XML"><![CDATA[
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:s="http://jboss.com/products/seam/taglib"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:rich="http://richfaces.org/rich"
-
xmlns:a4j="http://richfaces.org/a4j"
template="layout/template.xhtml">
- <ui:define name="body">
- <rich:panel>
- <f:facet name="header">BIRT Report Generator</f:facet>
- <a4j:form ajaxSubmit="true" reRender="criterion">
- <table>
- <tr>
- <td>Select sort order criterion:</td>
- <td><h:selectOneMenu onchange="submit()"
- value="#{ReportJB.sortOrder}"> <!-- Bind to your Java Bean -->
- <f:selectItem itemValue="buyprice" itemLabel="buy price"
/>
- <f:selectItem itemValue="quantityinstock" itemLabel="quantity in
stock" />
- </h:selectOneMenu>
- </td>
- </tr>
- </table>
- </a4j:form>
- <s:button
- view="/#{!empty reportParameters.order ? 'Products' :
'ProductsReport'}.xhtml" id="generate" value="Generate
Report" /> <!-- If the sertOrder variable is not set the button won't work
-->
- </rich:panel>
- </ui:define>
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j"
template="layout/template.xhtml">
+ <ui:define name="body">
+ <rich:panel>
+ <f:facet name="header">BIRT Report Generator</f:facet>
+ <a4j:form ajaxSubmit="true" reRender="criterion">
+ <table>
+ <tr>
+ <td>Select sort order criterion:</td>
+ <td><h:selectOneMenu onchange="submit()"
+ value="#{ReportJB.sortOrder}"> <!-- Bind to your Java Bean
-->
+ <f:selectItem itemValue="buyprice" itemLabel="buy
price" />
+ <f:selectItem itemValue="quantityinstock"
itemLabel="quantity in stock" />
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ </table>
+ </a4j:form>
+ <s:button
+ view="/#{!empty reportParameters.order ? 'Products' :
'ProductsReport'}.xhtml" id="generate" value="Generate
Report" />
+ <!-- If the sertOrder variable is not set the button won't work -->
+ </rich:panel>
+ </ui:define>
</ui:composition>
]]></programlisting>
<para>
@@ -145,7 +143,7 @@
</para>
</listitem>
<listitem>
- <para>Now you need to create the web page that will print the report, name the
file <filename>ProductsReport.xhtml</filename>.
+ <para>Now you need to create the web page that will print the report. Name the
file <filename>ProductsReport.xhtml</filename>.
The file to output the report should have the following content:</para>
<programlisting role="XML"><![CDATA[
@@ -177,25 +175,23 @@
<programlisting role="XML"><![CDATA[
xmlns:b="http://jboss.com/products/seam/birt"
]]></programlisting>
- <para>
- The dynamics to the report adds this line:
- </para>
+ <para>To set the <code>sortOrder</code> report parameter add this
line:</para>
<programlisting role="XML"><![CDATA[
<b:param name="sortOrder" value="#{ReportJB.sortOrder}" />
]]></programlisting>
- <para>We bound the <code>sortOrder</code> report parameter to Java
Bean variable <code>value="#{ReportJB.sortOrder}"</code>
using EL expression, and the value to the variable is assigned in the
<filename>ProductsForm.xhtml</filename> file. </para>
- <para>By default if you embed a report into HTML page the HTML-format report
contains the <html>,
- <head>, <body> etc., tags. However if your HTML page
already has those tags, you can rid of them using the
<code>embeddable="true"</code> attribute of
-
- the <emphasis
role="bold"><property><b:birt></property>
- </emphasis> component.</para>
+ <para>We bound the <code>sortOrder</code> report parameter to Java
Bean variable <code>value="#{ReportJB.sortOrder}"</code>
using EL expression, with the <code>ReportJB.sortOrder</code> variable having
its value assigned in the <filename>ProductsForm.xhtml</filename> file.
</para>
+
+ <note>
+ <title>Tip</title>
+ <para>
+ By default if you embed a report into HTML page the HTML-format report contains the
<html>, <head>, <body> etc., tags. However if
your HTML page already has those tags, you can rid of them using the
<code>embeddable="true"</code> attribute of the <emphasis
role="bold"><property><b:birt></property></emphasis>
component.
+ </para>
+ </note>
</listitem>
<listitem>
- <para>Deploy the project onto the server and open your browser to see the report
is successfully generated. You should navigate to
-
- <ulink
url="http://localhost:8080/yourProjectName/ProductForm.seam">http://localhost:8080/yourProjectName/ProductForm.seam</ulink>
to select the criterion and press the <property>Generate Report</property>
button. You will be redirected to the <ulink
url="http://localhost:8080/yourProjectName/ProductsReport.seam">http://localhost:8080/yourProjectName/ProductsReport.seam</ulink>
-
+ <para>
+ Deploy the project onto the server and open your browser to see the report is
successfully generated. You should navigate to <ulink
url="http://localhost:8080/yourProjectName/ProductForm.seam">http://localhost:8080/yourProjectName/ProductForm.seam</ulink>
to select the criterion and press the <guibutton>Generate Report</guibutton>
button. You will be redirected to <ulink
url="http://localhost:8080/yourProjectName/ProductsReport.seam">http://localhost:8080/yourProjectName/ProductsReport.seam</ulink>.
</para>
<figure>
<title>Dynamic Report</title>
@@ -251,10 +247,8 @@
</emphasis> file.</para>
</note>
- <para>In conclusion, the main goal of this document is to get you to know with a
full feature set
- that <property>JBoss BIRT Tools</property> provide. Thus if you have
some questions,
- comments or suggestions on the topic, please feel free to ask in the <ulink
url="http://www.jboss.org/index.html?module=bb&op=viewforum&...
- Tools Forum</ulink>. You can also influence on how you want to see
JBoss Tools docs in
- future leaving your vote on the article <ulink
url="http://www.jboss.org/community/docs/DOC-10795">Overview of the
improvements required by JBossTools/JBDS Docs users</ulink>.</para>
+ <para>
+ In conclusion, the main goal of this document is to describe the full feature set that
<property>JBoss BIRT Tools</property> provide. If you have any questions,
comments or suggestions on the topic, please feel free to ask in the <ulink
url="http://www.jboss.org/index.html?module=bb&op=viewforum&...
Tools Forum</ulink>. You can also influence on how you want to see JBoss Tools docs
infuture leaving your vote on the article <ulink
url="http://www.jboss.org/community/docs/DOC-10795">Overview of the
improvements required by JBossTools/JBDS Docs users</ulink>.
+ </para>
</section>
Modified: trunk/birt/docs/en-US/framework.xml
===================================================================
--- trunk/birt/docs/en-US/framework.xml 2011-03-08 23:40:12 UTC (rev 29634)
+++ trunk/birt/docs/en-US/framework.xml 2011-03-09 00:40:13 UTC (rev 29635)
@@ -24,7 +24,7 @@
<para>
- The <emphasis role="bold">
<property><b:birt></property></emphasis> component servers
to integrate a BIRT report into Seam/JSF container.
+ The <emphasis role="bold">
<property><b:birt></property></emphasis> component servers
to integrate a BIRT report into Seam or JSF container.
The <emphasis role="bold">
<property><b:birt></property></emphasis> tag recognizes
most of the parameters described on the BIRT
<ulink
url="http://www.eclipse.org/birt/phoenix/deploy/viewerUsage2.2.php#p...
Viewer Parameters</ulink> page, though it has attributes of its own.
Modified: trunk/birt/docs/en-US/links.xml
===================================================================
--- trunk/birt/docs/en-US/links.xml 2011-03-08 23:40:12 UTC (rev 29634)
+++ trunk/birt/docs/en-US/links.xml 2011-03-09 00:40:13 UTC (rev 29635)
@@ -15,8 +15,8 @@
<title>Other Relevant Resources on the Topic</title>
- <para>All JBoss Developer Studio/JBoss Tools release documentation you can
find at <ulink
url="http://docs.jboss.org/tools/">http://docs.jboss.org/too...
in the corresponding release directory.</para>
- <para>The latest documentation builds are available at <ulink
url="http://download.jboss.org/jbosstools/nightly-docs/">htt...;.
+ <para>You can find aditional JBoss Developer Studio documentation at
<ulink
url="http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/index....
documentaion</ulink> website.</para>
+ <para>The latest documentation builds are available through the <ulink
url="http://download.jboss.org/jbosstools/nightly-docs/">JBoss Tools Nightly
Docs Builds</ulink>.
</para>