Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Seam (BIRT) Recipe - Sample Report

Seam (BIRT) Recipe sample report:

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15" id="1">
    <property name="createdBy">Eclipse BIRT Designer Version 2.2.1.r221_v20070924 Build &lt;2.2.0.v20070924-1550></property>
    <property name="units">in</property>
    <data-sources>
        <script-data-source name="CustomersFavorite" id="2"/>
    </data-sources>
    <data-sets>
        <script-data-set name="Favorite" id="3">
            <list-property name="resultSetHints">
                <structure>
                    <property name="position">1</property>
                    <property name="name">Name</property>
                    <property name="dataType">any</property>
                </structure>
                <structure>
                    <property name="position">2</property>
                    <property name="name">Version</property>
                    <property name="dataType">any</property>
                </structure>
                <structure>
                    <property name="position">3</property>
                    <property name="name">Id</property>
                </structure>
            </list-property>
            <list-property name="columnHints">
                <structure>
                    <property name="columnName">Name</property>
                </structure>
                <structure>
                    <property name="columnName">Version</property>
                </structure>
                <structure>
                    <property name="columnName">Id</property>
                </structure>
            </list-property>
            <structure name="cachedMetaData">
                <list-property name="resultSet">
                    <structure>
                        <property name="position">1</property>
                        <property name="name">Name</property>
                        <property name="dataType">any</property>
                    </structure>
                    <structure>
                        <property name="position">2</property>
                        <property name="name">Version</property>
                        <property name="dataType">any</property>
                    </structure>
                    <structure>
                        <property name="position">3</property>
                        <property name="name">Id</property>
                        <property name="dataType">any</property>
                    </structure>
                </list-property>
            </structure>
            <property name="dataSource">CustomersFavorite</property>
            <method name="open"><![CDATA[var reports = Packages.org.jboss.seam.Component.getInstance("sampleReportList", true);
            reportsIterator = reports.getResultList().listIterator();]]></method>
            <method name="fetch"><![CDATA[if( !( reportsIterator.hasNext()) ){
	return( false );
}
 
var report = reportsIterator.next();
 
row["Name"] = report.name;
row["Version"] = report.version;
row["Id"] = new Packages.java.lang.Integer(report.id);
 
return ( true );]]></method>
            <method name="close"><![CDATA[reportsIterator = null;]]></method>
        </script-data-set>
    </data-sets>
    <page-setup>
        <simple-master-page name="Simple Master Page" id="4">
            <page-footer>
                <text id="5">
                    <property name="contentType">html</property>
                    <text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
                </text>
            </page-footer>
        </simple-master-page>
    </page-setup>
    <body>
        <label id="46">
            <property name="textAlign">center</property>
            <text-property name="text">Sample Report</text-property>
        </label>      
        <table id="19">
            <property name="width">100%</property>
            <property name="dataSet">Favorite</property>
            <list-property name="boundDataColumns">
                <structure>
                    <property name="name">Name</property>
                    <expression name="expression">dataSetRow["Name"]</expression>
                </structure>
                <structure>
                    <property name="name">Version</property>
                    <expression name="expression">dataSetRow["Version"]</expression>
                </structure>
                <structure>
                    <property name="name">Id</property>
                    <expression name="expression">dataSetRow["Id"]</expression>
                </structure>
            </list-property>
            <column id="22">
                <property name="width">0.7368421053in</property>
            </column>
            <column id="20">
                <property name="width">1.458in</property>
                <property name="repeat">1</property>
            </column>
            <header>
                <row id="23">
                    <property name="backgroundColor">#FF8040</property>
                    <cell id="28">
                        <label id="29">
                            <property name="backgroundColor">#FF8040</property>
                            <text-property name="text">Id</text-property>
                        </label>
                    </cell>
                    <cell id="24">
                        <label id="25">
                            <property name="backgroundColor">#FF8040</property>
                            <text-property name="text">Name</text-property>
                        </label>
                    </cell>
                </row>
            </header>
            <detail>
                <row id="30">
                    <list-property name="highlightRules">
                        <structure>
                            <property name="operator">eq</property>
                            <property name="backgroundColor">#E4B07C</property>
                            <property name="color">#000000</property>
                            <expression name="testExpr">row[0]%2</expression>
                            <expression name="value1">0</expression>
                        </structure>
                    </list-property>
                    <cell id="35">
                        <data id="36">
                            <property name="resultSetColumn">Id</property>
                        </data>
                    </cell>
                    <cell id="31">
                        <data id="32">
                            <property name="resultSetColumn">Name</property>
                        </data>
                    </cell>
                </row>
            </detail>
            <footer>
                <row id="37">
                    <cell id="40"/>
                    <cell id="38"/>
                </row>
            </footer>
        </table>
    </body>
</report>
<source>
[[Seam (BIRT) Recipe]]

Back to the top