Hi All,
I need to generate an XLS report wich contains a formula in cell.. but I'm having troubles with ", / and & .. formula is something like this
HYPERLINK(CONCATENATE("http://somedomain.com/script/blahblah.blah?v1=MOD00&v2=_&first_gr=",$F{TRN},"&last_gr=",$F{TRN},"&time=",CONCATENATE(TEXT(HOUR(NOW()),"00"),TEXT(MINUTE(NOW()),"00"),TEXT(SECOND(NOW()),"00")),"&list=0,SNL,_,_,_,all,_,_,_,_,_,",$F{TRN},",_,_,_,_,_,P1&posRepMag=&posRepMin="),"TRACK")
Thanks
Sergio
7 Answers:
I assume you already have looked at the docs and samples on how JasperReports exported works with formulas.
From what you are saying I think it may be an character escaping issue, it will be usefull to see the JRXML but blindly I'll say that you may not be using an expression, i.e.: if I want to do a A$P{param} + A5 your JRXML should look like this:
<reportElement key="textField-4" x="0" y="219" width="280" height="23">
<propertyExpression name="net.sf.jasperreports.export.xls.formula"><![CDATA["A" + $P{param} + "-A3"]]></propertyExpression>
</reportElement>
Actually ı tried it first and see it is working. Are you sure output is null when add the \ before " chars?
"=HYPERLINK(CONCATENATE(\"http://somedomain.com/script/blahblah.blah?v1=MOD00&v2=_&first_gr=\",$F{TRN},\"&last_gr=\",$F{TRN},\"&time=\",CONCATENATE(TEXT(HOUR(NOW()),\"00\"),TEXT(MINUTE(NOW()),\"00\"),TEXT(SECOND(NOW()),\"00\")),\"&list=0,SNL,_,_,_,all,_,_,_,_,_,\",$F{TRN},\",_,_,_,_,_,P1&posRepMag=&posRepMin=\"),\"TRACK\")"
There is something that I dont't urdestand..
Using sample db, I made the following simple report, but on HYPERLINK columns, exporting to xls, i have "null" in place of an hyperlink
</jasperReport>