cancel
Showing results for 
Search instead for 
Did you mean: 

Export to CSV not exporting correct values for some columns

Former Member
0 Kudos

I have a report with multiple columns. All values are in the report group footer. Some columns have formula's in them. When I view the report, all is fine. If I print to pdf, all is fine. If I export to Excel, all is fine. If I export to CSV, in some of the columns, I get the wrong value. It seems to be applying the formula differently when exporting to CSV for some of the columns. I am reproducing this just from within the designer. It is version 12.3.4.895. Any suggestions?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Good afternoon,

I'm having the same issue, have you had any luck on this?

In my case, PDF is fine but when exported to CSV the summary value changes. I wonder if it has something to do with the various groups.

Former Member
0 Kudos

Hi,

Make sure you've formatted your fields and their headers correctly. See here:

See http://stackoverflow.com/questions/2194421/issues-exporting-an-excel-file-from-crystal-reports

Also try here:

http://www.tek-tips.com/viewthread.cfm?qid=818103&page=169

Please be specific in what kinds of data is not being exported, or changed and how. Post some of the CSV raw data as it is in error if u can.

Thanks

John

Edited by: Johnbr on Jun 20, 2011 10:55 PM

Former Member
0 Kudos

We did fix our report. The resolution I received from support and that worked for us was:

The reason the result is different when exporting a report to CSV

format, is because the CSV format is a record based exporting format.

By default, when exporting to CSV format, it will evaluate and output

data for each record regardless of the report design.

In Crystal Reports XI R2, the CSV format was enhanced based on how

users were using the format, and we can now isolate groups and page

sections.

I looked at your report, and since the information you want to export

to CSV format is located in the Group Footer, section, my first

suggestion will be to check the CSV Export option: "Isolate Group

sections"

For most reports, this will export the report has expected to CSV

format, but on your report, you are using subreports and shared va

riables.

When exporting the report to CSV format, you still have some columns

displaying different information, and this is due to the shared

variables.

When using shared variables, best practice are to reset the shared

variables on the main report, and that was not done on this report.

I have created a formula to reset the shared variables in the Group

Header # 1, and now the report export the same information to CSV

format.

The formula to reset the shared variables looks like:

WhilePrintingRecords;

Shared DateVar var1 := Date(0,0,0);

Shared DateVar var2 := Date(0,0,0);

Shared DateVar var3 := Date(0,0,0);

The above is only a sample of what needs to be done. I will suggest to

review the modified reports, and confirm all the shared variables that

needs to be reset for each group is reset. Once this is done, your

report will export the expected information to CSV format.

In brief summary, for your report to export to CSV format:

1. Check the CSV Export Options: "Isolate Group sections"

2. Reset your shared variables in the Group Header section of the main

report.