Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Repeat one element
Repeat one element [message #148383] Mon, 27 March 2006 10:46 Go to next message
Jose Luis Ramirez Terry is currently offline Jose Luis Ramirez TerryFriend
Messages: 13
Registered: July 2009
Junior Member
How can I repeat one element in the same page? The number of iterations is
get by param. Thanks.
Re: Repeat one element [message #148779 is a reply to message #148383] Tue, 28 March 2006 03:36 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Without using the Design Engine api, you have to tie your element to
something that iterates on a datasource.
A simple way to do this is create a Scripted Data Source and Set. Check
your parameter in the fetch event of the data set and then tie this
dataset to a list or table control that holds your item you want to iterate.
Below is an example of this using a label in a table. Look at the fetch
event on the
data set.

Jason

<?xml version="1.0" encoding="UTF-8"?>

<!-- Written by Eclipse BIRT 2.0 -->

<report xmlns="http://www.eclipse.org/birt/2005/design" version="3" id="1">

<property name="createdBy">Eclipse BIRT Designer Version 2.0.0 Build
&lt;20060123-1141></property>

<property name="units">in</property>

<list-property name="configVars">

<structure>

<property name="name">iter</property>

<property name="value">5</property>

</structure>

</list-property>

<parameters>

<scalar-parameter name="iter" id="39">

<property name="valueType">static</property>

<property name="dataType">decimal</property>

<property name="allowBlank">false</property>

<property name="format">Unformatted</property>

<property name="controlType">text-box</property>

<property name="defaultValue">1</property>

</scalar-parameter>

</parameters>

<data-sources>

<script-data-source name="Data Source" id="4"/>

</data-sources>

<data-sets>

<script-data-set name="outer" id="5">

<property name="dataSource">Data Source</property>

<list-property name="resultSet">

<structure>

<property name="position">1</property>

<property name="name">c1</property>

<property name="dataType">integer</property>

</structure>

</list-property>

<list-property name="columnHints">

<structure>

<property name="columnName">c1</property>

</structure>

</list-property>

<method name="open"><![CDATA[i=0;]]></method>

<method name="fetch"><![CDATA[if (i++ >= params["iter"])

return false;

else {

row.c1=i;

return true;

}]]></method>

</script-data-set>

</data-sets>

<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="width">100%</property>

<property name="dataSet">outer</property>

<column id="16"/>

<header>

<row id="8">

<cell id="9"/>

</row>

</header>

<detail>

<row id="11">

<cell id="12">

<label id="10">

<text-property name="text">Test Label Could Be an Image or other
Element</text-property>

</label>

</cell>

</row>

</detail>

<footer>

<row id="14">

<cell id="15"/>

</row>

</footer>

</table>

</body>

</report>

"Jose Luis Ramirez Terry" <joseluis@i2e.com.es> wrote in message
news:1bf050822fbb86ead27d068729b44d08$1@www.eclipse.org...
> How can I repeat one element in the same page? The number of iterations is
> get by param. Thanks.
>
Re: Repeat one element [message #148812 is a reply to message #148779] Tue, 28 March 2006 07:35 Go to previous messageGo to next message
Jose Luis Ramirez Terry is currently offline Jose Luis Ramirez TerryFriend
Messages: 13
Registered: July 2009
Junior Member
This question is because I have paper with labels for print in dot matrix.
I think print one grid and the user input by param the number of labels
for print, then repeat this grid with the space of labels.
Re: Repeat one element [message #149040 is a reply to message #148812] Tue, 28 March 2006 13:17 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You should be able to do this, if you put the grid and the labels in the
detail row of a list or table and then use the scripted datasource/set I
already posted.

Jason

"Jose Luis Ramirez Terry" <joseluis@i2e.com.es> wrote in message
news:c2af4490cb6018747d952018cbd32c81$1@www.eclipse.org...
> This question is because I have paper with labels for print in dot matrix.
> I think print one grid and the user input by param the number of labels
> for print, then repeat this grid with the space of labels.
>
>
Previous Topic:print
Next Topic:Report Data Export
Goto Forum:
  


Current Time: Sat Jul 27 19:20:58 GMT 2024

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

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

Back to the top