Surrounding data with double quotation marks

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: 4 years 9 months ago

2 Answers:

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
18784
Joined: Sep 26 2006 - 8:06pm
Last seen: 9 months 1 week ago

This is exacly what resolves my problem. Thanks.

piotr.ziolkowski's picture
Joined: Jun 7 2018 - 1:10am
Last seen: 4 years 9 months ago
Feedback