|
Re: Populating a table column-by-column [message #539194 is a reply to message #539116] |
Wed, 09 June 2010 21:52 |
|
I am not certain what you mean by:
I only want to populate the second column only when the first column is
full. If you are referring to page breaks and page break interval, BIRT
2.5 now allows fix page layout or auto page layout.
Jason
On 6/9/2010 12:50 PM, Dermot wrote:
> Hi, I'm using BIRT 3.2.3 on Eclipse 3.4.2
> I'm trying to do something I thought would already be done but can't
> find it anywhere.
>
> I have a number of columns on a page and I want to populate the columns
> in the order that they appear.
> I only want to populate the second column only when the first column is
> full.
> I need to do this because I want the table contents all on same page,
> until the page is full.
> The number of elements in my table varies with each execution so I can
> not calculate the number of rows.
>
> The contents of my table depend on the previous values in the table so I
> have to populate the cells in the table in sequence.
>
> Any suggestions/solutions would be a great help.
>
> Thank you.
>
|
|
|
|
Re: Populating a table column-by-column [message #539356 is a reply to message #539302] |
Thu, 10 June 2010 14:11 |
|
Understood. Right now (2.5.2) the only way to do this is to use a grid
with 3 columns and put the same table in each grid and then filter the
row number(add computed column to calc rownumber) on each table. Take a
look at the attached example. You also may want to investigate crosstabs.
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="comments">Copyright (c) 2007 <<Your Company
Name here>></property>
<property name="createdBy">Eclipse BIRT Designer Version
2.5.2.v20100208 Build <2.5.2.v20100210-0630></property>
<html-property name="description">Creates a blank report with no
predefined content.</html-property>
<property name="units">in</property>
<text-property name="displayName">Blank Report</text-property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="layoutPreference">auto layout</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="6">
<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="7">
<list-property name="computedColumns">
<structure>
<property name="name">rwc</property>
<expression
name="expression">row["ORDERNUMBER"]</expression>
<property name="dataType">integer</property>
<property
name="aggregateFunction">RUNNINGCOUNT</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]]></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:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="crosstab" id="4">
<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="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>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<property name="topMargin">1in</property>
<property name="leftMargin">1.25in</property>
<property name="bottomMargin">1in</property>
<property name="rightMargin">1.25in</property>
<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="42">
<property name="width">100%</property>
<column id="43"/>
<column id="44"/>
<row id="45">
<cell id="46">
<table id="8">
<property name="width">100%</property>
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property
name="name">ORDERNUMBER</property>
<expression
name="expression">dataSetRow["ORDERNUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property
name="name">PRODUCTCODE</property>
<expression
name="expression">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">QUANTITYORDERED</property>
<expression
name="expression">dataSetRow["QUANTITYORDERED"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<expression
name="expression">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property
name="name">ORDERLINENUMBER</property>
<expression
name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">Column
Binding</property>
<expression
name="expression">row.__rownum</expression>
<property name="dataType">any</property>
</structure>
<structure>
<property name="name">rwc</property>
<expression
name="expression">dataSetRow["rwc"]</expression>
<property
name="dataType">integer</property>
</structure>
</list-property>
<property name="pageBreakInterval">50</property>
<list-property name="filter">
<structure>
<property name="operator">ne</property>
<expression
name="expr">row["rwc"]%2</expression>
<simple-property-list name="value1">
<value>0</value>
</simple-property-list>
</structure>
</list-property>
<column id="51"/>
<column id="37"/>
<column id="39"/>
<header>
<row id="9">
<cell id="48">
<label id="53">
<text-property
name="text">Computed row count</text-property>
</label>
</cell>
<cell id="10">
<label id="11">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="14">
<label id="15">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="20">
<cell id="49">
<data id="54">
<property
name="resultSetColumn">rwc</property>
</data>
</cell>
<cell id="21">
<data id="22">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="25">
<data id="26">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="31">
<cell id="50"/>
<cell id="32"/>
<cell id="34"/>
</row>
</footer>
</table>
</cell>
<cell id="47">
<table id="55">
<property name="width">100%</property>
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property
name="name">ORDERNUMBER</property>
<expression
name="expression">dataSetRow["ORDERNUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property
name="name">PRODUCTCODE</property>
<expression
name="expression">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">QUANTITYORDERED</property>
<expression
name="expression">dataSetRow["QUANTITYORDERED"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<expression
name="expression">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property
name="name">ORDERLINENUMBER</property>
<expression
name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">Column
Binding</property>
<expression
name="expression">row.__rownum</expression>
<property name="dataType">any</property>
</structure>
<structure>
<property name="name">rwc</property>
<expression
name="expression">dataSetRow["rwc"]</expression>
<property
name="dataType">integer</property>
</structure>
</list-property>
<property name="pageBreakInterval">50</property>
<list-property name="filter">
<structure>
<property name="operator">eq</property>
<expression
name="expr">row["rwc"]%2</expression>
<simple-property-list name="value1">
<value>0</value>
</simple-property-list>
</structure>
</list-property>
<column id="74"/>
<column id="75"/>
<column id="76"/>
<header>
<row id="56">
<cell id="57">
<label id="77">
<text-property
name="text">Computed row count</text-property>
</label>
</cell>
<cell id="59">
<label id="60">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="61">
<label id="62">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="63">
<cell id="64">
<data id="65">
<property
name="resultSetColumn">rwc</property>
</data>
</cell>
<cell id="66">
<data id="67">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="68">
<data id="69">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="70">
<cell id="71"/>
<cell id="72"/>
<cell id="73"/>
</row>
</footer>
</table>
</cell>
</row>
</grid>
</body>
</report>
On 6/10/2010 6:35 AM, Dermot wrote:
> Apologies, I'm not explaining myself very well.
> Thanks for your reply, I'll have a look at 2.5 to see if the solution is
> there.
>
> I'll try to clarify my problem a little better here:
>
> A table is normally populated one row at a time and the next row is not
> populated until the current row is finished.
>
> row1:item1 | row1:item2 | row1:item3
> row2:item1 | row2:item2 | row2:item3
> row3:item1 | row3:item2 | row3:item3
>
> I have a case where I want to populate the columns first. I'm looking
> for a way to populate the cell in row1:item1 then populate the cell in
> row2:item1... when the first column is populated I want to then fill in
> the cell in row1:item2, then the cell in row2:item2, ....
>
> I hope that clarifies my question a little...
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03090 seconds