Skip to main content



      Home
Home » Archived » BIRT » Conditional text after repeated header
Conditional text after repeated header [message #176202] Mon, 10 July 2006 09:48 Go to next message
Eclipse UserFriend
Hi BIRT-team & community,

I've a pretty large report, which is spread over several pages in the
PDF-Output. The report has a group in it and the group header is
repeated on the following pages (option "Page break - Repeat Header" is
activated).

Is there any possibility to change the group header expression if it
is repeated on the next page(s)?
E.g the group header expression is
"Topic: " + row["Topic"]
If the same group is continued on the next page, it should read as
following:
"Topic: " + row["Topic"] + "(Continuation)"


Kind regards,

/// wj
Re: Conditional text after repeated header [message #176541 is a reply to message #176202] Tue, 11 July 2006 23:09 Go to previous message
Eclipse UserFriend
I tried several things here and settled on setting the expression for the
data element
to dataSetRow["STATUS"] + somevariable.
I planned on just changing the somevariable in the page break event.
Issues:
1 - repeated header value expression doesnt get checked when used in pdf so
although the page break event will let you modify it,
it want be used.
2 - If the data element is moved to the detail row it will get used. So I
added a data field in the detail row and turned off duplicates.
3 - That is why you will see in the attached example that I am using
Continued and Continued. alternating. This is definately not
ideal, but maybe it can get you started.

Run the report and look at the status group and you will see shipped has
multiple pages (PDF).

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.2.2"
id="1">

<property name="createdBy">Eclipse BIRT Designer Version
2.1.0.N20060628-1351 Build &lt;20060628-1537></property>

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

<property name="comments">Copyright (c) 2006 &lt;&lt;Your Company Name
here>></property>

<method name="initialize"><![CDATA[contdstr = "";

testval = "";

oldstatus = "";]]></method>

<data-sources>

<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc"
name="Data Source" id="4">

<text-property name="displayName">Data Source</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="5">

<text-property name="displayName">Data Set</text-property>

<list-property name="resultSet">

<structure>

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

<property name="name">ORDERNUMBER</property>

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

<property name="nativeDataType">4</property>

</structure>

<structure>

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

<property name="name">ORDERDATE</property>

<property name="dataType">date-time</property>

<property name="nativeDataType">91</property>

</structure>

<structure>

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

<property name="name">REQUIREDDATE</property>

<property name="dataType">date-time</property>

<property name="nativeDataType">91</property>

</structure>

<structure>

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

<property name="name">SHIPPEDDATE</property>

<property name="dataType">date-time</property>

<property name="nativeDataType">91</property>

</structure>

<structure>

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

<property name="name">STATUS</property>

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

<property name="nativeDataType">12</property>

</structure>

<structure>

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

<property name="name">COMMENTS</property>

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

<property name="nativeDataType">12</property>

</structure>

<structure>

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

<property name="name">CUSTOMERNUMBER</property>

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

<property name="nativeDataType">4</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">ORDERDATE</property>

<property name="dataType">date-time</property>

</structure>

<structure>

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

<property name="name">REQUIREDDATE</property>

<property name="dataType">date-time</property>

</structure>

<structure>

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

<property name="name">SHIPPEDDATE</property>

<property name="dataType">date-time</property>

</structure>

<structure>

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

<property name="name">STATUS</property>

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

</structure>

<structure>

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

<property name="name">COMMENTS</property>

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

</structure>

<structure>

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

<property name="name">CUSTOMERNUMBER</property>

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

</structure>

</list-property>

</structure>

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

<property name="queryText">select *

from orders</property>

</oda-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="6">

<property name="width">100%</property>

<property name="dataSet">Data Set</property>

<list-property name="boundDataColumns">

<structure>

<property name="name">STATUS</property>

<expression name="expression">dataSetRow["STATUS"]</expression>

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

</structure>

<structure>

<property name="name">ORDERNUMBER</property>

<expression name="expression">dataSetRow["ORDERNUMBER"]</expression >

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

</structure>

<structure>

<property name="name">ORDERDATE</property>

<expression name="expression">dataSetRow["ORDERDATE"]</expression>

<property name="dataType">date-time</property>

</structure>

<structure>

<property name="name">ModifyStatus</property>

<expression name="expression">contdstr</expression>

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

</structure>

</list-property>

<method name="onPageBreak"><![CDATA[test =
this.getRowData().getColumnCount();

testval = this.getRowData().getColumnValue("STATUS");

//ModifyStatus

var t1 = testval + "";

var t2 = oldstatus + "";

var t3 = this.getRowData().getColumnValue("ModifyStatus") + "";

if( t1 == t2 )

{

if( t3 == "Continued" ){

contdstr = "Continued."

}else{


contdstr = "Continued";

}

}else{

contdstr = "";

}


oldstatus=testval;]]></method>

<column id="19">

<property name="suppressDuplicates">true</property>

</column>

<column id="20"/>

<column id="21"/>

<header>

<row id="7">

<cell id="8"/>

<cell id="9">

<label id="24">

<text-property name="text">ORDERNUMBER</text-property>

</label>

</cell>

<cell id="10">

<label id="26">

<text-property name="text">ORDERDATE</text-property>

</label>

</cell>

</row>

</header>

<group id="28">

<property name="groupName">NewTableGroup1</property>

<property name="interval">none</property>

<property name="sortDirection">asc</property>

<expression name="keyExpr">row["STATUS"]</expression>

<property name="repeatHeader">true</property>

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

<property name="pageBreakAfter">auto</property>

<property name="pageBreakBefore">auto</property>

<header>

<row id="29">

<cell id="30">

<data id="37">

<property name="resultSetColumn">STATUS</property>

</data>

</cell>

<cell id="31"/>

<cell id="32"/>

</row>

</header>

<footer>

<row id="33">

<cell id="34"/>

<cell id="35"/>

<cell id="36"/>

</row>

</footer>

</group>

<detail>

<row id="11">

<cell id="12">

<data id="38">

<property name="resultSetColumn">ModifyStatus</property>

</data>

</cell>

<cell id="13">

<data id="25">

<property name="resultSetColumn">ORDERNUMBER</property>

</data>

</cell>

<cell id="14">

<data id="27">

<method name="onRender"><![CDATA[hide=0;]]></method>

<property name="resultSetColumn">ORDERDATE</property>

</data>

</cell>

</row>

</detail>

<footer>

<row id="15">

<cell id="16"/>

<cell id="17"/>

<cell id="18"/>

</row>

</footer>

</table>

</body>

</report>

"wj" <wj313@gmx.net> wrote in message news:e8tlpc$a53$1@utils.eclipse.org...
> Hi BIRT-team & community,
>
> I've a pretty large report, which is spread over several pages in the
> PDF-Output. The report has a group in it and the group header is repeated
> on the following pages (option "Page break - Repeat Header" is activated).
>
> Is there any possibility to change the group header expression if it is
> repeated on the next page(s)?
> E.g the group header expression is
> "Topic: " + row["Topic"]
> If the same group is continued on the next page, it should read as
> following:
> "Topic: " + row["Topic"] + "(Continuation)"
>
>
> Kind regards,
>
> /// wj
>
Previous Topic:Can you use a String/inputString Obj containing XML for the datasource?
Next Topic:charting whole numbers
Goto Forum:
  


Current Time: Fri May 02 10:53:08 EDT 2025

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

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

Back to the top