Home » Archived » BIRT » How to display the contents of the previous row in the report?
How to display the contents of the previous row in the report? [message #251189] |
Fri, 03 August 2007 19:55  |
Eclipse User |
|
|
|
Originally posted by: ishen.ilog.com
I have a report with three columns as follow:
------------------------------
Year, Beginning Tax, Ending Tax,
2007, 100, 200
2008, 200, 150
2009, 150, 300
------------------------------
I would like to display the "beginning tax" column of each row (from the
second row onwards" to be exactly the same number as the "ending tax"
value in previous row. for each row, the "ending tax" is a total.sum()
over a group and I defined it as a data item (EndingTaxEle).
How can I achieve this? does the Total.runningCount() help?
I would expect something like: Row[EndingTaxEle] with previous row number
(Total.runningCount()-1)? but I do not know how to express it properly.
Thanks a lot in advance!
|
|
|
Re: How to display the contents of the previous row in the report? [message #251207 is a reply to message #251189] |
Fri, 03 August 2007 22:38   |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Iris,
You should be able to do this using script.
Setup a variable in the beforeFactory
myvar = "n/a";
and then in the onCreate script of the ending tax data element
myvar = this.getValue();
In the expression for the beginning tax data element enter:
myvar;
Jason
Iris Shen wrote:
> I have a report with three columns as follow:
>
> ------------------------------
> Year, Beginning Tax, Ending Tax,
> 2007, 100, 200
> 2008, 200, 150
> 2009, 150, 300
> ------------------------------
>
> I would like to display the "beginning tax" column of each row (from the
> second row onwards" to be exactly the same number as the "ending tax"
> value in previous row. for each row, the "ending tax" is a total.sum()
> over a group and I defined it as a data item (EndingTaxEle).
>
> How can I achieve this? does the Total.runningCount() help?
> I would expect something like: Row[EndingTaxEle] with previous row
> number (Total.runningCount()-1)? but I do not know how to express it
> properly.
>
> Thanks a lot in advance!
>
>
|
|
|
Re: How to display the contents of the previous row in the report? [message #251350 is a reply to message #251207] |
Mon, 06 August 2007 16:25   |
Eclipse User |
|
|
|
Originally posted by: ishen.ilog.com
Hi, Jason,
Thank you very much, I tried the scripting, it works for copying the data
from the previous row!!
However if I have a little bit more complicated structure like:
year, region, brand, Beginning Tax, Ending Tax
2006 US A1 100 200
A2 200 300
2006 CA A1 300 400
A2 400 500
2007 US A1 200 210
A2 300 310
2007 CA A1 400 410
A2 500 510
I first group by year, then by the region, last by the brand.
Now I would like to copy the "Beginning Tax" of the same region/same brand
from the previous year's "Enging Tax" as in above example.
How can I achieve this by using script? (Sorry, I am new to BIRT script,
if this is a too naive question, could you point to somewhere for my
self-learning.)
Thanks a lot!
Iris,
|
|
|
Re: How to display the contents of the previous row in the report? [message #251494 is a reply to message #251350] |
Tue, 07 August 2007 12:03  |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Iris,
This becomes more complex when using groups, because of the way birt
does binding. The binding are actually calculated before the scripts
are executed. To get around this you can use a simple Text control.
Take a look at this example. I reset the previous variable on the
onCreate for group row 1.
Jason
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.14"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.2.0.v20070620 Build <2.2.0.v20070626-1003></property>
<property name="units">in</property>
<property name="comments">Copyright (c) 2007 <<Your Company
Name here>></property>
<html-property name="description">Creates a blank report with no
predefined content.</html-property>
<method
name="beforeFactory"><![CDATA[reportContext.setPersistentGlobalVariable( "prev","N/A");]]></method>
<text-property name="displayName">Blank Report</text-property>
<property name="iconFile">/templates/blank_report.gif</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="6">
<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="7">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">CUSTOMERNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">CONTACTLASTNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">CONTACTFIRSTNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">PHONE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">ADDRESSLINE1</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">ADDRESSLINE2</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">CITY</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">9</property>
<property name="name">STATE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">10</property>
<property name="name">POSTALCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">11</property>
<property name="name">COUNTRY</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">12</property>
<property
name="name">SALESREPEMPLOYEENUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">13</property>
<property name="name">CREDITLIMIT</property>
<property name="dataType">float</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNUMBER</property>
<property name="nativeName">CUSTOMERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">CUSTOMERNAME</property>
<property name="nativeName">CUSTOMERNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">CONTACTLASTNAME</property>
<property name="nativeName">CONTACTLASTNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">CONTACTFIRSTNAME</property>
<property name="nativeName">CONTACTFIRSTNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">PHONE</property>
<property name="nativeName">PHONE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">ADDRESSLINE1</property>
<property name="nativeName">ADDRESSLINE1</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">ADDRESSLINE2</property>
<property name="nativeName">ADDRESSLINE2</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">CITY</property>
<property name="nativeName">CITY</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">9</property>
<property name="name">STATE</property>
<property name="nativeName">STATE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">10</property>
<property name="name">POSTALCODE</property>
<property name="nativeName">POSTALCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">11</property>
<property name="name">COUNTRY</property>
<property name="nativeName">COUNTRY</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">12</property>
<property name="name">SALESREPEMPLOYEENUMBER</property>
<property
name="nativeName">SALESREPEMPLOYEENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">13</property>
<property name="name">CREDITLIMIT</property>
<property name="nativeName">CREDITLIMIT</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
</list-property>
<property name="queryText">select *
from customers</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>CUSTOMERNUMBER</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:attributes>
<design:usageHints>
<design:label>CUSTOMERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CUSTOMERNAME</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>CUSTOMERNAME</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CONTACTLASTNAME</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>CONTACTLASTNAME</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CONTACTFIRSTNAME</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>CONTACTFIRSTNAME</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PHONE</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>PHONE</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ADDRESSLINE1</design:name>
<design:position>6</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>ADDRESSLINE1</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ADDRESSLINE2</design:name>
<design:position>7</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>ADDRESSLINE2</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CITY</design:name>
<design:position>8</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>CITY</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>STATE</design:name>
<design:position>9</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>STATE</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>POSTALCODE</design:name>
<design:position>10</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>POSTALCODE</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>COUNTRY</design:name>
<design:position>11</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>COUNTRY</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>SALESREPEMPLOYEENUMBER</design:name>
<design:position>12</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>SALESREPEMPLOYEENUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CREDITLIMIT</design:name>
<design:position>13</design:position>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>CREDITLIMIT</design:label>
<design:formattingHints>
<design:displaySize>22</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">
<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="8">
<property name="width">100%</property>
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">CUSTOMERNUMBER</property>
<expression
name="expression">dataSetRow["CUSTOMERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">CUSTOMERNAME</property>
<expression
name="expression">dataSetRow["CUSTOMERNAME"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">CONTACTLASTNAME</property>
<expression
name="expression">dataSetRow["CONTACTLASTNAME"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">CONTACTFIRSTNAME</property>
<expression
name="expression">dataSetRow["CONTACTFIRSTNAME"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">PHONE</property>
<expression
name="expression">dataSetRow["PHONE"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">ADDRESSLINE1</property>
<expression
name="expression">dataSetRow["ADDRESSLINE1"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">ADDRESSLINE2</property>
<expression
name="expression">dataSetRow["ADDRESSLINE2"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">CITY</property>
<expression
name="expression">dataSetRow["CITY"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">STATE</property>
<expression
name="expression">dataSetRow["STATE"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">POSTALCODE</property>
<expression
name="expression">dataSetRow["POSTALCODE"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">COUNTRY</property>
<expression
name="expression">dataSetRow["COUNTRY"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">SALESREPEMPLOYEENUMBER</property>
<expression
name="expression">dataSetRow["SALESREPEMPLOYEENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">CREDITLIMIT</property>
<expression
name="expression">dataSetRow["CREDITLIMIT"]</expression >
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">Column Binding</property>
<expression
name="expression">reportContext.getPersistentGlobalVariable( "prev");</expression>
<property name="dataType">any</property>
</structure>
<structure>
<property name="name">Column Binding_1</property>
<expression
name="expression">countrychange</expression>
<property name="dataType">any</property>
</structure>
</list-property>
<column id="166"/>
<column id="175"/>
<column id="77"/>
<column id="78"/>
<column id="84"/>
<column id="85"/>
<column id="89"/>
<header>
<row id="9">
<cell id="159"/>
<cell id="168"/>
<cell id="10">
<label id="11">
<text-property
name="text">CUSTOMERNUMBER</text-property>
</label>
</cell>
<cell id="12">
<label id="13">
<text-property
name="text">CUSTOMERNAME</text-property>
</label>
</cell>
<cell id="24">
<label id="25">
<text-property name="text">CITY</text-property>
</label>
</cell>
<cell id="26">
<label id="27">
<text-property
name="text">STATE</text-property>
</label>
</cell>
<cell id="34">
<label id="35">
<text-property
name="text">CREDITLIMIT</text-property>
</label>
</cell>
</row>
</header>
<group id="90">
<property name="groupName">NewTableGroup1</property>
<property name="interval">none</property>
<property name="sortDirection">asc</property>
<expression name="keyExpr">row["COUNTRY"]</expression>
<structure name="toc">
<expression
name="expressionValue">row["COUNTRY"]</expression>
</structure>
<property name="repeatHeader">true</property>
<property name="hideDetail">false</property>
<property name="pageBreakAfter">auto</property>
<property name="pageBreakBefore">auto</property>
<property name="pageBreakInside">auto</property>
<header>
<row id="91">
<method
name="onCreate"><![CDATA[reportContext.setPersistentGlobalVariable( "prev","N/A");]]></method>
<property name="backgroundColor">#008000</property>
<cell id="160"/>
<cell id="169"/>
<cell id="92">
<data id="119">
<property
name="resultSetColumn">COUNTRY</property>
</data>
</cell>
<cell id="93"/>
<cell id="99"/>
<cell id="100"/>
<cell id="104"/>
</row>
</header>
<footer>
<row id="105">
<cell id="164"/>
<cell id="173"/>
<cell id="106"/>
<cell id="107"/>
<cell id="113"/>
<cell id="114"/>
<cell id="118"/>
</row>
</footer>
</group>
<group id="120">
<property name="groupName">NewTableGroup2</property>
<property name="interval">none</property>
<property name="sortDirection">asc</property>
<expression name="keyExpr">row["CITY"]</expression>
<structure name="toc">
<expression
name="expressionValue">row["CITY"]</expression>
</structure>
<property name="repeatHeader">true</property>
<property name="hideDetail">false</property>
<property name="pageBreakAfter">auto</property>
<property name="pageBreakBefore">auto</property>
<property name="pageBreakInside">auto</property>
<header>
<row id="121">
<property name="backgroundColor">#FFFF00</property>
<cell id="161"/>
<cell id="170"/>
<cell id="122">
<data id="149">
<property
name="resultSetColumn">CITY</property>
</data>
</cell>
<cell id="123"/>
<cell id="129"/>
<cell id="130"/>
<cell id="134"/>
</row>
</header>
<footer>
<row id="135">
<cell id="163"/>
<cell id="172"/>
<cell id="136"/>
<cell id="137"/>
<cell id="143"/>
<cell id="144"/>
<cell id="148"/>
</row>
</footer>
</group>
<detail>
<row id="36">
<cell id="162">
<data id="167">
<property name="resultSetColumn">Column
Binding_1</property>
</data>
</cell>
<cell id="171">
<text id="176">
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "prev");</VALUE-OF>]]></text-property>
</text>
</cell>
<cell id="37">
<data id="38">
<method name="onCreate"><![CDATA[var prev =
this.getValue();
reportContext.setPersistentGlobalVariable("prev",prev);]]> </method>
<property
name="resultSetColumn">CUSTOMERNUMBER</property>
</data>
</cell>
<cell id="39">
<data id="40">
<property
name="resultSetColumn">CUSTOMERNAME</property>
</data>
</cell>
<cell id="51">
<data id="52">
<property
name="resultSetColumn">CITY</property>
</data>
</cell>
<cell id="53">
<data id="54">
<property
name="resultSetColumn">STATE</property>
</data>
</cell>
<cell id="61">
<data id="62">
<property
name="resultSetColumn">CREDITLIMIT</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="63">
<cell id="165"/>
<cell id="174"/>
<cell id="64"/>
<cell id="65"/>
<cell id="71"/>
<cell id="72"/>
<cell id="76"/>
</row>
</footer>
</table>
</body>
</report>
Iris Shen wrote:
> Hi, Jason,
> Thank you very much, I tried the scripting, it works for copying the
> data from the previous row!!
>
> However if I have a little bit more complicated structure like:
> year, region, brand, Beginning Tax, Ending Tax
> 2006 US A1 100 200
> A2 200 300
> 2006 CA A1 300 400
> A2 400 500
>
> 2007 US A1 200 210
> A2 300 310
> 2007 CA A1 400 410
> A2 500 510
>
>
> I first group by year, then by the region, last by the brand.
> Now I would like to copy the "Beginning Tax" of the same region/same
> brand from the previous year's "Enging Tax" as in above example.
> How can I achieve this by using script? (Sorry, I am new to BIRT script,
> if this is a too naive question, could you point to somewhere for my
> self-learning.)
> Thanks a lot!
> Iris,
|
|
|
Goto Forum:
Current Time: Sat May 10 18:59:39 EDT 2025
Powered by FUDForum. Page generated in 0.04381 seconds
|