I would like to know if there is a way to escape dollar ($) sign in JasperReport (I'am using Dynamic Jasper) I tried the unicode and xml escape but it doesn't work.
I get this error :
1. Syntax error on token "$F", { expected
value = $F{$}; //$JR_EXPR_ID=13$
<>
The Dynamic Jasper Report Code is :
drb.setTitle(screenTitleData)
.setSubtitle(styledSubTitle)
.setTitleStyle(titleStyle).setTitleHeight(new Integer(30))
.setSubtitleHeight(new Integer(20))
.setDetailHeight(new Integer(8))//defines the height for each record of the report
.setMargins(margin, margin, margin, margin)
.setDefaultStyles(titleStyle, null, headerStyle, columDetail)
.setPrintBackgroundOnOddRows(true)
.setOddRowBackgroundStyle(oddRowStyle)
.setColumnsPerPage(new Integer(1))//defines columns per page (like in the telephone guide)
.setColumnSpace(new Integer(5))
.setWhenNoData(SwtConstants.DYNAMIC_JASPER_NO_DATA_FOUND, null,true,true)
.setQuery(queryResult.getExecutedQuery(), DJConstants.QUERY_LANGUAGE_SQL);
as you see i'm using "setQuery" I have the list of columns saved in a object, so I browse the list to create the columns using this code :
// Varchar columns will not be styled
abstractColumn = ColumnBuilder.getNew()
.setColumnProperty(columns.get(i).getColumnLabel(), String.class.getName())
.setTitle(columns.get(i).getColumnLabel()).setWidth(85)
.setStyle(commonStyle).setHeaderStyle(headerStyle)
.build();
if you want to reproduce this error just type a query like :
Select '$' from dual
Please note that the same error occur with "}" char too.
Can anyone help me please ?