Skip to main content



      Home
Home » Archived » BIRT » Read Value of a NamedExpressionValue(How can i read a vlaue of namedExpression Value at PresentationTime)
Read Value of a NamedExpressionValue [message #1679389] Mon, 16 March 2015 11:47 Go to next message
Eclipse UserFriend
I use eclipse 4.4.1, windows 8.1, java 7, birt 4.4.1 and the Example Database of BIRT. I want to make all in java.

I have a report with a table with 6 columns
Columns 1-5 with Databinding
Column 6 with the following Expression:
BirtMath.multiply(dataSetRow["QUANTITYORDERED"],dataSetRow["PRICEEACH"])
with DataType float and name "TOTAL_ROW"


In the table footer I added a Data with following Expression
Total.sum(row["TOTAL_ROW"])
with DataType float and name "TOTAL"

In the Row i added the following RowEventHandle
	@Override
	public void onCreate(IRowInstance arg0, IReportContext arg1)
			throws ScriptException {
		try {
			Double price = (Double) arg0.getRowData().getExpressionValue(
					"row[TOTAL_ROW]");
			Double totalPrice1 = (Double) arg0.getRowData().getExpressionValue(
					"row[TOTAL]");
			Double totalPrice2 = (Double) arg0.getParent()
					.getNamedExpressionValue("TOTAL");
			
			if (price.doubleValue() > totalPrice1.doubleValue() / 50)
				arg0.getStyle().setBackgroundColor("red");
		} catch (ScriptException e) {
			e.printStackTrace();
		}
	}



For the variables price and totalPrice1 I get the correct values.
But for the variable totalPrice2 I get always null

Attached I send the Report-File
Re: Read Value of a NamedExpressionValue [message #1682430 is a reply to message #1679389] Tue, 17 March 2015 14:37 Go to previous message
Eclipse UserFriend
What is the named expression value? I don't see any named expressions set in your sample design attached.
Previous Topic:Custom XML based data source
Next Topic:Dynamic number of bar charts needs to be placed one after another
Goto Forum:
  


Current Time: Thu Mar 20 04:34:06 EDT 2025

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

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

Back to the top