Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to .csv problem with a formula to suppress details

Status
Not open for further replies.

huytonscouser

Programmer
Oct 14, 2011
88
US
When i export a report to .csv format AND the report has a formula to suppress some rows from details section, the exported data contains blanks rows for those rows that have been suppressed.



When i remove the suppression formula, data is exported in .csv format without issue.


I using all the default options settings in the export .csv window.



Any ideas ?

i'm using cr11 and excel 2010
 
How are you handling the suppression? Rather than suppressing the rows you don't want, are you able to amend the record selection formula so as not to include those rows in the first place?

Perhaps if you explain a bit more about the report structure we may be able to offer alternative approaches.

Cheers
Pete
 
Thanks Pete, that would certianly work if the data returned was unique.
The report returns rows for devices, and the same device may get reported multiple time legitimately as there are several paths to it.
As i only want to total the device size once, i use a formula to set the device size to zero except for the last entry, and then i have a suppress formula in section expert to take care of small sizes.

{@Dev Size GB} < 0.1

The formula to calculate the device size and zero duplicates is :-

evaluateafter({@Shared device});

//if "NEXT" IN{@Shared device } and {SRMARRAYDEVICE.ISSHARED} = "Y" then 0
if onlastrecord
THEN IF {SRMARRAYDEVICE.ISMETADEVICE} = "Yes"
THEN {SRMARRAYDEVICE.METADEVICETOTAL}/1024/1024
ELSE {SRMARRAYDEVICE.ARRAYDEVTOTAL}/1024/1024
ELSE



if "FIRST" IN{@Shared device} OR "NEXT" IN{@Shared device} then 0
else IF {SRMARRAYDEVICE.ISMETADEVICE} = "Yes"
THEN {SRMARRAYDEVICE.METADEVICETOTAL}/1024/1024
ELSE {SRMARRAYDEVICE.ARRAYDEVTOTAL}/1024/1024


Thanks for any help.

 
OK. That will make it more difficult. There may be ways to achieve this but without understanding your data and the report requirements I can't offer much assistance I'm sorry. My guess is that if you are familiar with SQL it should be possible to create a Command (or database View or Stored Procedure) on which to base the report that returns the single row you need, so as to avoid the need to suppress anything.

Alternatively, maybe someone else on this forum can offer something.

Cheers
Pete
 
If you can't figure out a way to do this with Crystal alone, one of the 3rd-party Crystal Reports schedulers listed at allows you to automate the process of exporting to any of the supprted text formats and immediately removing any blank (or short) lines in the resulting text file. The final file can automatically be emailed, placed in a dynamically named/created folder, FTP/SFTP uploaded, etc.

Alternatively, you can create a simple program to do the file cleanup. The logic is very simple.

hth,
- Ido

view, export, burst, email, and schedule Crystal Reports.
 
Well i cannot wait, and appreciate all help. I export the data to .xlsx which does not have an issue when the data is suppressed, and only contains the correct rows. I then use the .xlsx file in another report, and just export to .csv. Long winded but at least it works.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top