|
Re: Compare value in detail row [message #692991 is a reply to message #692828] |
Tue, 05 July 2011 15:14 |
|
There is a previous row aggregate function extension example on birt
exchange that could be used to show you how to implement your own
aggregate function.
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1103-aggregate-function-to-subtract-previous-row-value/
Or you could do it all in a data item expression like:
importPackage(Packages.java.lang);
var rwc = 0;
if( reportContext.getGlobalVariable("last") == null ){
rwc = row.__rownum*10+400
reportContext.setGlobalVariable("last", new
Integer(dataSetRow["ORDERNUMBER"]));
reportContext.setGlobalVariable("lastrwc", new Integer(rwc));
}else{
if( parseInt(reportContext.getGlobalVariable("last")) ==
dataSetRow["ORDERNUMBER"] ){
rwc = reportContext.getGlobalVariable("lastrwc");
}else{
rwc = row.__rownum*10+400
}
reportContext.setGlobalVariable("last", new
Integer(dataSetRow["ORDERNUMBER"]));
reportContext.setGlobalVariable("lastrwc", new Integer(rwc));
}
rwc;
See attached example.
Jason
On 7/5/2011 6:12 AM, forums-noreply@eclipse.org wrote:
> In my report I have a table with a detail row with the value
> dataSetRow["step"]
>
> I want to number my rows with the following rule:
> row.__rownum*10+400 (400, 410, 420, ...)
>
> But if the value of dataSetRow["step"] is the same as the row before,
> the row number has also have the same number.
>
> Can I create such like:
> if (dataSetRow["stap"] == previous.dataSetRow["stap"])
> {
> rownum = previous.rownum
> }
>
> I hope i've descriped my problem clear on this way.
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04067 seconds