Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Data Connectivity
Message Icon Topic: problems creating csv file to export Post Reply Post New Topic
Author Message
CRNewbie32
Newbie
Newbie
Avatar

Joined: 14 Oct 2008
Location: United States
Online Status: Offline
Posts: 22
Quote CRNewbie32 Replybullet Topic: problems creating csv file to export
    Posted: 22 Jul 2009 at 8:34am
A co-worker has created some reports (he uses Crystal X but I have the same issue in X or XI) to extract data to csv files for people to use for Hyperion imports. I do not get the same results as he does--either in Preview or when exporting the file as csv.
 
1st issue:
The report in preview mode has commas where it shouldn't have them.
GH1   Actual06
GH2   03
GH3   03
D        9,6204140100,12,09000,175.00
 
Detail line should be:
           96204140100,1209000,175.00
 
2. When I export to csv, it puts the headers from GH1, GH2 and GH3 as a prefix on every detail line. They should be individual lines at the top of the csv file.
 
I've applied every hot fix/patch I can find but cannot fix this. Any thoughts would be greatly appreciated!


Edited by CRNewbie32 - 22 Jul 2009 at 11:33am
TrytoworkwithSQLServerCrystal
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 23 Jul 2009 at 9:06am

For the extra commas, format the numbers so that they don't have thousand separators (right-click on field, Format Field, Number tab.)

For the group header issues, check the advanced options on your export.
 
-Dell
IP IP Logged
CRNewbie32
Newbie
Newbie
Avatar

Joined: 14 Oct 2008
Location: United States
Online Status: Offline
Posts: 22
Quote CRNewbie32 Replybullet Posted: 23 Jul 2009 at 9:30am
Formatting the numbers (I had already looked into this-maybe should have put more detail in the first post):
The detail row is a big text field, that is filled up with formula fields. The first number (shows as 9,620 but should be 9620) is a formula where he converts an integer field with ToText. So it should be text going into the report. When I try to edit that field, it doesn't even show a number tab.
 
Having PC issues, will reply on the group header issues if I can't figure that out later. Thanks!
TrytoworkwithSQLServerCrystal
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 23 Jul 2009 at 12:03pm

Here are a couple of things you can try:

1.  Change the Report options.  Go to File, Options and go to the Fields tab.  Click on the Number button and set the number format.

2.  In your call to ToText, use three parameters.  The last one is the thousands separator.  It would look something like this:
 
ToText({table.field}, 0, "")
 
-Dell
IP IP Logged
CRNewbie32
Newbie
Newbie
Avatar

Joined: 14 Oct 2008
Location: United States
Online Status: Offline
Posts: 22
Quote CRNewbie32 Replybullet Posted: 23 Jul 2009 at 12:40pm
I did number 1 and changing it to -1123.00 fixed the formatting issue in Preview mode.
 
When I do export, I don't see "advanced options".
I choose:
Format:CSV
Destination: disk file
Separator: remove "," from Character and remove ' " ' from Delimiter
Check both "Same number formats..." and "Same date formats..."
Then I give it a file name.
(all these options work for my co-worker when he exports)
 
I click Okay. I still get the group headers as a prefix.
 
I've checked help, I've looked over File, Options and I've Googled. I still can't get it to export with prefixing every line.
TrytoworkwithSQLServerCrystal
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.031 seconds.