Surrounding data with double quotation marks

0

Hi,
I try to generate report schema in CSV format. I have to wrap each data in double quoutes. I've tried to use concatenate function [CONCATENATE("\"",$F{data},"\"")] in textFieldExpression but I only got data wrapped in three double quotes ["""210023258"""]. Is there any easy way to get rid of this unnecessary signs? I've found  that I can extend some java class, and there add this signs, but I prefer to change somtehing in jrxml schema rather than writing a code.

piotr.ziolkowski's picture
Joined: Jun 7 2018 - 1:10am
Last seen: 1 year 1 month ago

2 Answers:

2

If you need each exported data to be enclosed within double quotes, set the following property in your report:

<property name="net.sf.jasperreports.export.csv.force.field.enclosure" value="true"/>

Set the textfield expression as $F{data}.

shertage's picture
1932
Joined: Sep 26 2006 - 8:06pm
Last seen: 2 days 11 hours ago
0

This is exacly what resolves my problem. Thanks.

piotr.ziolkowski's picture
Joined: Jun 7 2018 - 1:10am
Last seen: 1 year 1 month ago
Feedback
randomness