Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Display outter table information based on inner table entry
Display outter table information based on inner table entry [message #515487] Thu, 18 February 2010 22:52 Go to next message
Neil Wang is currently offline Neil WangFriend
Messages: 105
Registered: July 2009
Senior Member
Hi,

I have a report that has one table nested in another table. If I would like to display the outter table based on an entry in the inner table, how should I do it?

For example, in the report below, if I would like to display CUSTOMERNAME when LASTNAME does not start with 'A', what can be done to achieve this? I tried to set visibility on the table that has CUSTOMERNAME but it can only see CUSTOMERNAME, not LASTNAME.

Here is the report:

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 2.5.1.v20090903 Build &lt;2.5.1.v20090917-1447></property>
<property name="units">in</property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="15">
<text-property name="displayName"></text-property>
<property name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
<property name="odaURL">jdbc:classicmodels:sampledb</property>
<property name="odaUser">ClassicModels</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet " name="Data Set" id="16">
<list-property name="columnHints">
<structure>
<property name="columnName">CUSTOMERNAME</property>
<text-property name="displayName">CUSTOMERNAME</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNAME</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNAME</property>
<property name="nativeName">CUSTOMERNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select
CLASSICMODELS.CUSTOMERS.CUSTOMERNAME
from CLASSICMODELS.CUSTOMERS]]></xml-property>
<xml-property name="designerValues"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
<model:DesignValues
xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
<design:ResultSets derivedMetaData="true">
<design:resultSetDefinitions>
<design:resultSetColumns>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CUSTOMERNAME</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>CUSTOMERNAME</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>CUSTOMERNAME</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
</design:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet " name="Data Set1" id="17">
<list-property name="columnHints">
<structure>
<property name="columnName">LASTNAME</property>
<text-property name="displayName">LASTNAME</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">LASTNAME</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">LASTNAME</property>
<property name="nativeName">LASTNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select
CLASSICMODELS.EMPLOYEES.LASTNAME
from CLASSICMODELS.EMPLOYEES]]></xml-property>
<xml-property name="designerValues"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
<model:DesignValues
xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
<design:ResultSets derivedMetaData="true">
<design:resultSetDefinitions>
<design:resultSetColumns>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>LASTNAME</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>LASTNAME</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>LASTNAME</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
</design:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="report" id="4">
<property name="fontFamily">sans-serif</property>
<property name="fontSize">10pt</property>
</style>
<style name="crosstab" id="5">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="crosstab-cell" id="6">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<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>
<table id="7">
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">CUSTOMERNAME</property>
<text-property name="displayName">CUSTOMERNAME</text-property>
<expression name="expression">dataSetRow["CUSTOMERNAME"]</expression >
<property name="dataType">string</property>
</structure>
</list-property>
<column id="14"/>
<header>
<row id="8">
<cell id="9">
<label id="18">
<text-property name="text">CUSTOMERNAME</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="10">
<cell id="11">
<data id="19">
<property name="resultSetColumn">CUSTOMERNAME</property>
</data>
</cell>
</row>
<row id="20">
<cell id="21">
<table id="22">
<property name="dataSet">Data Set1</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">LASTNAME</property>
<text-property name="displayName">LASTNAME</text-property>
<expression name="expression">dataSetRow["LASTNAME"]</expression>
<property name="dataType">string</property>
</structure>
</list-property>
<column id="29"/>
<header>
<row id="23">
<cell id="24">
<label id="30">
<text-property name="text">LASTNAME</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="25">
<cell id="26">
<data id="31">
<property name="resultSetColumn">LASTNAME</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="27">
<cell id="28"/>
</row>
</footer>
</table>
</cell>
</row>
</detail>
<footer>
<row id="12">
<cell id="13"/>
</row>
</footer>
</table>
</body>
</report>


please advise,

regards,

Neil
Re: Display outter table information based on inner table entry [message #515502 is a reply to message #515487] Fri, 19 February 2010 02:52 Go to previous messageGo to next message
Richard A. Polunsky is currently offline Richard A. PolunskyFriend
Messages: 212
Registered: July 2009
Location: Houston TX
Senior Member

Neil,

I can't tell from reading the XML. Is there any direct link/filter between your outer and inner tables? Basically the inner table is a black box to the containing object. Is there a reason why you can't write your outer table query such that it includes the LASTNAME field?

There's probably a BIRT expert out there who can tell you how from an outer table cell event you can traverse into the inner table and across all of its rows to see whether any row matches your criterion - but I can guarantee you will be better served pushing that kind of decision into the outer table query.

Richard
Re: Display outter table information based on inner table entry [message #515667 is a reply to message #515502] Fri, 19 February 2010 17:20 Go to previous message
Neil Wang is currently offline Neil WangFriend
Messages: 105
Registered: July 2009
Senior Member
Hi Richard,

Thank you for your comment.
The XML is meant to be used to create a report.
Yes, I noticed an inner table is like a black box to the containing table. I cannot have the entries in the inner table to show up in the containing table because I have two different datasets which contribute to each table separately. Yes, I think I will need to find out how to traverse inner table entry values from the containing table but am not sure how to do it.

regards,

Neil
Previous Topic:BIRT, OS X, and internal browser preview
Next Topic:Birt ODA Problem
Goto Forum:
  


Current Time: Thu Apr 25 17:35:48 GMT 2024

Powered by FUDForum. Page generated in 0.02950 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top