Changing comma in CSV to a Tab Globally in Jasperserver

0

My question is how can I change the delimiter in my jasperserver file exports. It is the customary "," now and I want to change that to a tab. I want to make this change globally within my server not individually for each report if I can. I have searched and found several answers but none seem to work for me. The various solution mainly talked about making the change for specific reports not globally. The other solutions were for iReports not Jasperserver. I am running jasper server 4.7 on tomcat 6 within ubuntu 10.04. One solution that got me the closest talked about changing the file applicationContext.xml. When I go into that file and change the line below ","  to "something else it works". The problem is that I can't find the proper way to represent a tab. If I do "\t" it comes out literal. If I change it to any number of other xml entities that I have found for tab the server will not restart. If I actually do "then hit the tab key" it puts " for some reason.

 

<bean id="csvExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.CsvExportParametersBean">    <property name="fieldDelimiter" value=","/>
  </bean>
 
twinkiejr's picture
Joined: Sep 13 2010 - 11:17am
Last seen: 4 years 3 months ago

3 Answers:

2

The above answer would not work the applicationContext.xml overrides jasperreports.properties. I finally got it to work by using &#009; in the applicationContext.xml.

 

<bean id="csvExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.CsvExportParametersBean"> <property name="fieldDelimiter" value=","/> </bean>

Changed to

<bean id="csvExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.CsvExportParametersBean"> <property name="fieldDelimiter" value="&#009;"/> </bean>

twinkiejr's picture
Joined: Sep 13 2010 - 11:17am
Last seen: 4 years 3 months ago

That´s new for me. Thanks for your hint.
Thomas

Thomas Zimmer - 6 years 4 months ago

I have tried your solutions above with no success. Just to check, when I click on a cube it gives me certain counts. When I click on the total it open a new window which gives me an option to do an Excel export (csv) which needs to be semi-colon delimited. Am I looking in the right place?

Thanks

Carlo

carloh - 4 years 5 months ago
1

You can do this by setting the global jasperreports.properties (file should be located at <js-install>/tomcat/webapps/WEB-INF/classes/jasperreports.properties or similar).

Have a look at the config reference:

http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.csv.field.delimiter

Cheers, Thomas

http://www.thomaszimmer.net

Thomas Zimmer's picture
Joined: Oct 2 2012 - 1:35am
Last seen: 5 days 11 hours ago

I was not able to use your suggestion. The jasperreports.properties file gets overridden. I posted my resolution below. If you know how I can make it work using the jasperreports.properties file I would prefer to do it that way, it looks a lot simpler. I tried commenting out the lines of code in the applicationContext.xml file but when I did jasperserver would not reboot. I am sure there is something else that I need to comment out further up the chain but as it is working for now I will leave that for another day. Thanks for your help.

twinkiejr - 6 years 4 months ago
0

Edit: posted to wrong thread

kcollins's picture
4177
Joined: Aug 30 2011 - 12:22pm
Last seen: 1 month 4 weeks ago

Sorry wrong thread, please ignore.

kcollins - 5 years 4 months ago

I have tried your solutions above with no success. Just to check, when I click on a cube it gives me certain counts. When I click on the total it open a new window which gives me an option to do an Excel export (csv) which needs to be semi-colon delimited. Am I looking in the right place?

Thanks

Carlo

carloh - 4 years 5 months ago
Feedback