Print Page | Close Window

Exporting to Excel problem

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15436
Printed Date: 06 May 2024 at 6:19am


Topic: Exporting to Excel problem
Posted By: dbodell
Subject: Exporting to Excel problem
Date Posted: 24 Jan 2012 at 6:44am
I have a report with columns for each month and year. The formula for the column heading is monthname(month(datefield)) + " " + totext(datepart("yyyy",datefield)).  I have also used year(datefield) instead of datepart. When I run the report in Crystal, I get a nice column name like January 2012.  However, when I export to Excel, I get January 2,012.00 !  I have tried any number of things and cannot get it to export properly. It isn't exporting a number so why would it interpret that part of a formula field as a number?
 
Any assistance is much appreciated.


-------------
Thanks,
D. Bodell



Replies:
Posted By: yggdrasil
Date Posted: 25 Jan 2012 at 2:27am
Excel has a weird and wonderful way with what it thinks is a date.
Since what you want is a text string, as a first attempt I would put a ' in front like
 
"'" + monthname(month(datefield)) + " " + totext(datepart("yyyy",datefield))
 
Hopefully, Excel will then regard it as text and leave it alone.


Posted By: dbodell
Date Posted: 25 Jan 2012 at 6:36am
Thanks very much! I'll try that!Tongue

-------------
Thanks,
D. Bodell



Print Page | Close Window