Jump to content
We've recently updated our Privacy Statement, available here ×

Changing comma in CSV to a Tab Globally in Jasperserver


twinkiejr
Go to solution Solved by twinkiejr,

Recommended Posts

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>[/code]
[/code]
Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

  • Solution

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

 

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

 

 

Changed to

 

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

 

 

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • 11 months later...
  • 10 months later...

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...