Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Exporting to Excel problem Post Reply Post New Topic
Author Message
dbodell
Groupie
Groupie
Avatar

Joined: 08 Nov 2011
Location: United States
Online Status: Offline
Posts: 53
Quote dbodell Replybullet Topic: Exporting to Excel problem
    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
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet 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.
IP IP Logged
dbodell
Groupie
Groupie
Avatar

Joined: 08 Nov 2011
Location: United States
Online Status: Offline
Posts: 53
Quote dbodell Replybullet Posted: 25 Jan 2012 at 6:36am
Thanks very much! I'll try that!Tongue
Thanks,
D. Bodell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.