plar Posted February 20, 2017 Share Posted February 20, 2017 HiWe have a studio report where we are using "new java.util.Date()" field to populate the date in the report. The date field appears fine on the report but when exported to excel the format changes.For example, In the report date field appears as "February 20, 2017" but when it is exported to excel it changes to "F 20, 2017". So, we have to manually format the filed in excel to short date and it appears as 2/20/2017.Our objective is to eliminate the manual job to update the date filed format in excel, please suggest me ideas. Is there anything that we can do in Jaspersoft?Thank you,Arjun Link to comment Share on other sites More sharing options...
hozawa Posted February 20, 2017 Share Posted February 20, 2017 I remember doing this but not sure if this is the way I did it. I think I've set "net.sf.jasperreports.export.xls.pattern" property and used xlsx export. Link to comment Share on other sites More sharing options...
plar Posted February 20, 2017 Author Share Posted February 20, 2017 Hi HozawaThank you for the response.Could you please help me with detailed instructions on adding the property, I am new to Jaspersoft. Link to comment Share on other sites More sharing options...
plar Posted February 21, 2017 Author Share Posted February 21, 2017 I tried giving this property to report but it doesn't seem to be working. 'Went to Properties view and selecting "Advanced" tab and select "Misc" -> "Properties"Name = net.sf.jasperreports.export.xls.patternValue = trueAny other sugegstion? Link to comment Share on other sites More sharing options...
reportdev Posted February 21, 2017 Share Posted February 21, 2017 1. try replacing the field with DATEFORMAT(new Date(), "MM/dd/yyyy" )2. Enter the Source code of jrxml by clicking on the Source tab for the report3. you should find some property name, value pairs like below<property name="ireport.jasperserver.user" value="reportdev"/>4. At the end of these properties copy below property and save/publish<property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now