Export to .csv file (Urgent)

mustafvi
mustafvi used Ask the Experts™
on
Hi all,
I want to export my Crystal Report to .csv file.
I am using .Net with C#(ASP.Net).
How i can do this in .Net Framework using ASP.Net (C#)??


Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
Take a look at

http://support.crystaldecisions.com/communityCS/FilesAndUpdates/csharp_web_export.exe.asp

you wil have to change the file type to CSV

mlmcc

Author

Commented:
Dear mlmcc,

in the above link, it is not mentioned to export in .csv file.
so, please first do the thing and then mail me the exact answer.

Please, mustafvi, for 50 points - don't be too demanding.
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
I don't have .Net or C# so I took a shot that it had what you wanted.  

I believe the examples show how to export.

I thought the only thing you would have to do is
1.  Set the export type - TOFILE rather than TOAPPLICATION
2.  Set the diskfile name
3.  Set the fileexporttype to creftCSV (i think that is the type for a CSV file)

C# may require other things.

Sorry.
mlmcc

Author

Commented:
Dear,
How i can do the above mentioned things.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Did you look at the code supplied in the earlier link?  Is any of it useful?  If so post it.  I can give you what works in VB but the .NET & C# are much different.

mlmcc

Author

Commented:
Dear all,
How i can export .rpt to .csv file.

Following is the Source code to export it into PDF format on export button in C#(ASP.Net). Please reveiw it and reply me the code of export in .csv file


               CrystalReport1 myrpt = new CrystalReport1();
               CrystalDecisions.Shared.DiskFileDestinationOptions ds = new CrystalDecisions.Shared.DiskFileDestinationOptions();
               myrpt.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
               myrpt.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
               ds.DiskFileName="D:\\Test\\MyReport.pdf";
               myrpt.ExportOptions.DestinationOptions = ds;
               myrpt.Export();
Can you not search for 'ExportFormatType' in your help files and find the option for CSV?

I also do not have .NET
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Try
myrpt.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.CSV;

myrpt.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.CommaSeparatedValues;

ds.DiskFileName="D:\\Test\\MyReport.csv";

mlmcc

Author

Commented:
Dear all,

When i try to use the above thing it shows me an error message as
CrystalDecisions.Shared.ExportFormatType ,
does not contain a definition for 'CSV',
so, please check it and then mail me.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Just went looking for some documentation.

The .NET documentation is in the MSDN documentation

http://msdn.microsoft.com/library/?url=/library/en-us/crystlmn/html/crconcrystalreports.asp?frame=true


According to this it doesn't seem to hace a CSV export capability.  Here are the formats it lists.

Member Name Description
Excel        Export format of the report is a Microsoft Excel file.
HTML32       Export format of the report is an HTML 3.2 file.
HTML40       Export format of the report is an HTML 4.0 file.
NoFormat     No export format specified.
PortableDocFormat     Export format of the report is a PDF file.
RichText     Export format of the report is a rich text file.
WordForWindows     Export format of the report is a Microsoft Word file.

sorry
mlmcc
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Just verified using the feature comparison pdf from CR.
The export formats are on page 3 of the document and CSV is not supported by .NET

http://support.crystaldecisions.com/communityCS/TechnicalPapers/cr9feat_ver.pdf

mlmcc
Do you have a fancy layout that you are exporting from?

If your goal is just to export to CSV then we could probably do it another way.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Could export to Excel then go to CSV.
Could write an asp application to export the recordset.

mlmcc

Commented:
This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in approximately one week.  I would appreciate any comments by the experts that would help me in making a recommendation.

It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help.jsp#hs5

mnye
EE Cleanup Volunteer
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
My last 2 comments showed what he wants to do can't be done with his version of Crystal.

mlmcc
Wrong!

Your last two comments have little to do with it!  But maybe a couple before then.

Please give the points to mike - errm - mlmcc.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
You're right.  must have been asleep when I looked at that one.

mlmcc

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: mlmcc {http:#7571146}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

mnye
EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial