Print Page | Close Window

problems creating csv file to export

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7121
Printed Date: 05 May 2024 at 1:08am


Topic: problems creating csv file to export
Posted By: CRNewbie32
Subject: problems creating csv file to export
Date 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!


-------------
TrytoworkwithSQLServerCrystal



Replies:
Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: CRNewbie32
Date 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


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: CRNewbie32
Date 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



Print Page | Close Window