Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » [2.5.2]Display thin Table on wide page
[2.5.2]Display thin Table on wide page [message #553053] Mon, 16 August 2010 05:33 Go to next message
Benoit is currently offline Benoit
Messages: 1
Registered: August 2010
Junior Member
Hi,

I'm using BIRT 2.5.2. I have a thin Table populated with a scriptedDataSet. I would like to have two or three "columns" of this Table display on my page, to avoid big blank on the right, to obtain something like this :
-------------
row1 | row5
row2 | row6
row3 | row7
row4 | row8
-------------
row9
row10
 
 
-------------


Is there a way to do something like this ? I find anythind during my tests and researches...

Thanks in advance,

Benoît
Re: [2.5.2]Display thin Table on wide page [message #553172 is a reply to message #553053] Mon, 16 August 2010 11:09 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You could always create a computed column on the dataset that uses a
running count to count the number of rows and then add a grid with 2-3
columns. In each column put the same table and then filter on the
computed column for row count. See attached example:

Jason

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.21"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.5.2.v20100208 Build &lt;2.5.2.v20100210-0630></property>
<property name="units">in</property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<property name="imageDPI">96</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="7">
<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>
<property name="OdaConnProfileName"></property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="Data Set" id="8">
<list-property name="computedColumns">
<structure>
<property name="name">rwc</property>
<property name="dataType">integer</property>
<property
name="aggregateFunction">RUNNINGCOUNT</property>
<list-property name="arguments">
<structure>
<property name="name">Expression</property>
<expression
name="value">row["ORDERNUMBER"]</expression>
</structure>
</list-property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
</structure>
<structure>
<property name="columnName">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
</structure>
<structure>
<property name="columnName">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
</structure>
<structure>
<property name="columnName">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
</structure>
<structure>
<property name="columnName">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">rwc</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select *
from orderdetails
where ordernumber = 10104
order by orderlinenumber]]></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>ORDERNUMBER</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERNUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRODUCTCODE</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PRODUCTCODE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRODUCTCODE</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>QUANTITYORDERED</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>QUANTITYORDERED</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>QUANTITYORDERED</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRICEEACH</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PRICEEACH</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRICEEACH</design:label>
<design:formattingHints>
<design:displaySize>22</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERLINENUMBER</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>5</design:nativeDataTypeCode>
<design:precision>5</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERLINENUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERLINENUMBER</design:label>
<design:formattingHints>
<design:displaySize>6</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
<design:criteria/>
</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>
<grid id="9">
<column id="10"/>
<column id="11"/>
<column id="12"/>
<row id="13">
<cell id="14"/>
<cell id="15"/>
<cell id="16"/>
</row>
<row id="17">
<cell id="18">
<table id="99">
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property
name="name">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERNUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property
name="name">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
<expression name="expression"
type="javascript">dataSetRow["QUANTITYORDERED"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property
name="name">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERLINENUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">rwc</property>
<text-property
name="displayName">rwc</text-property>
<expression name="expression"
type="javascript">dataSetRow["rwc"]</expression>
<property
name="dataType">integer</property>
</structure>
</list-property>
<list-property name="filter">
<structure>
<property name="operator">eq</property>
<expression name="expr"
type="javascript">(row["rwc"]-1)%3</expression>
<simple-property-list name="value1">
<value>0</value>
</simple-property-list>
</structure>
</list-property>
<column id="123"/>
<column id="124"/>
<column id="125"/>
<column id="126"/>
<header>
<row id="100">
<cell id="101">
<label id="102">
<text-property
name="text">rwc</text-property>
</label>
</cell>
<cell id="103">
<label id="104">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="105">
<label id="106">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="107">
<label id="108">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="109">
<cell id="110">
<data id="111">
<property
name="resultSetColumn">rwc</property>
</data>
</cell>
<cell id="112">
<data id="113">
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="114">
<data id="115">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="116">
<data id="117">
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="118">
<cell id="119"/>
<cell id="120"/>
<cell id="121"/>
<cell id="122"/>
</row>
</footer>
</table>
</cell>
<cell id="19">
<table id="71">
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property
name="name">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERNUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property
name="name">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
<expression name="expression"
type="javascript">dataSetRow["QUANTITYORDERED"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property
name="name">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERLINENUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">rwc</property>
<text-property
name="displayName">rwc</text-property>
<expression name="expression"
type="javascript">dataSetRow["rwc"]</expression>
<property
name="dataType">integer</property>
</structure>
</list-property>
<list-property name="filter">
<structure>
<property name="operator">eq</property>
<expression name="expr"
type="javascript">(row["rwc"]-2)%3</expression>
<simple-property-list name="value1">
<value>0</value>
</simple-property-list>
</structure>
</list-property>
<column id="95"/>
<column id="96"/>
<column id="97"/>
<column id="98"/>
<header>
<row id="72">
<cell id="73">
<label id="74">
<text-property
name="text">rwc</text-property>
</label>
</cell>
<cell id="75">
<label id="76">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="77">
<label id="78">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="79">
<label id="80">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="81">
<cell id="82">
<data id="83">
<property
name="resultSetColumn">rwc</property>
</data>
</cell>
<cell id="84">
<data id="85">
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="86">
<data id="87">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="88">
<data id="89">
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="90">
<cell id="91"/>
<cell id="92"/>
<cell id="93"/>
<cell id="94"/>
</row>
</footer>
</table>
</cell>
<cell id="20">
<table id="25">
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property
name="name">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERNUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property
name="name">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
<expression name="expression"
type="javascript">dataSetRow["QUANTITYORDERED"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property
name="name">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERLINENUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">rwc</property>
<text-property
name="displayName">rwc</text-property>
<expression name="expression"
type="javascript">dataSetRow["rwc"]</expression>
<property
name="dataType">integer</property>
</structure>
</list-property>
<list-property name="filter">
<structure>
<property name="operator">eq</property>
<expression name="expr"
type="javascript">(row["rwc"]-3)%3</expression>
<simple-property-list name="value1">
<value>0</value>
</simple-property-list>
</structure>
</list-property>
<column id="68"/>
<column id="60"/>
<column id="61"/>
<column id="63"/>
<header>
<row id="26">
<cell id="65">
<label id="69">
<text-property
name="text">rwc</text-property>
</label>
</cell>
<cell id="29">
<label id="30">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="31">
<label id="32">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="35">
<label id="36">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="39">
<cell id="66">
<data id="70">
<property
name="resultSetColumn">rwc</property>
</data>
</cell>
<cell id="42">
<data id="43">
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="44">
<data id="45">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="48">
<data id="49">
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="52">
<cell id="67"/>
<cell id="54"/>
<cell id="55"/>
<cell id="57"/>
</row>
</footer>
</table>
</cell>
</row>
<row id="21">
<cell id="22"/>
<cell id="23"/>
<cell id="24"/>
</row>
</grid>
</body>
</report>



On 8/16/2010 5:33 AM, Benoit wrote:
> Hi,
>
> I'm using BIRT 2.5.2. I have a thin Table populated with a
> scriptedDataSet. I would like to have two or three "columns" of this
> Table display on my page, to avoid big blank on the right, to obtain
> something like this :
> -------------
> row1 | row5
> row2 | row6
> row3 | row7
> row4 | row8
> -------------
> row9
> row10
>
>
> -------------
>
> Is there a way to do something like this ? I find anythind during my
> tests and researches...
>
> Thanks in advance,
>
> Benoît
Previous Topic:Table breaking with very large data
Next Topic:Add parameters to already existing DataSetHandle (using the birt API)
Goto Forum:
  


Current Time: Fri Aug 22 17:56:49 EDT 2014

Powered by FUDForum. Page generated in 0.01749 seconds