I am looking for some good examples of how to export Crystal Report data to MS Excel in a proper format. The format will be exactly like it displays in Crystal report such Report Title, summary, column titiles etc.
using (ReportClass rptH = new ReportClass())
{
rptH.FileName = @"C:/Report/crJournal.rpt"; //Your rpt file path // if you put your rpt file on Bin then you need to write only rpt file name
rptH.Load();
rptH.SetDataSource( ds );// Provide Dataset for report : Ds is DataSet
rptH.ExportToDisk(ExportFormatType.Excel, "Give Output file path");
}
Hopet
Narasappa C J
ravi.jadiyannavar@gmail.com
Pls Mark This Post As Answer If it Helps U..
Thanku
Crystal report(2008) has a built in function to export to MS Excel, it can export to two kinds of format:
1. MS (97-2003)(*.xls), this format is good (the title is generated), but it generates a lot of blank columns in the report, which is hard to read by a program. As the exported MS Report is not only for reading by user, it also used to be read by a program.
So, those blank columns will generate errors.
2. MS Excel(97-2003) Data-Only (*.xls): the column data in Crystal report are exported properly (it is good to be read by a program), but the Title and footer are missing.
So what I want is to combine these two report together, which has title and footer and column data generated properly (no empty columns).
I appraciate anybody can provide some good examples to achieve my goal, thanks a lot.
Crystal report(2008) has a built in function to export to MS Excel, it can export to two kinds of format:
1. MS (97-2003)(*.xls), this format is good (the title is generated), but it generates a lot of blank columns in the report, which is hard to read by a program. As the exported MS Report is not only for reading by user, it also used to be read by a program.
So, those blank columns will generate errors.
2. MS Excel(97-2003) Data-Only (*.xls): the column data in Crystal report are exported properly (it is good to be read by a program), but the Title and footer are missing.
So what I want is to combine these two report together, which has title and footer and column data generated properly (no empty columns).
I appraciate anybody can provide some good examples to achieve my goal, thanks a lot.
Peter Cong
Member
527 Points
681 Posts
How to export Crystal Report data to a MS Excel format?
Mar 13, 2012 03:07 AM|LINK
Hi,
I am looking for some good examples of how to export Crystal Report data to MS Excel in a proper format. The format will be exactly like it displays in Crystal report such Report Title, summary, column titiles etc.
Thanks a lot for any advice and examples,
t
subhash.shel...
Contributor
2137 Points
487 Posts
Re: How to export Crystal Report data to a MS Excel format?
Mar 13, 2012 03:20 AM|LINK
Hi,
Please ref. the below link...it might help you..
http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/2635d479-5960-4306-9daf-0da2cb9f01e4/
http://aspalliance.com/478_Exporting_to_Excel_in_Crystal_Reports_NET__Perfect_Excel_Exports.all
Subhash
Please, Mark as Answer if this reply helped you.
cnranasinghe
Star
8899 Points
1800 Posts
Re: How to export Crystal Report data to a MS Excel format?
Mar 13, 2012 10:51 AM|LINK
You can use da built in export functionality on CR
http://aspalliance.com/478_Exporting_to_Excel_in_Crystal_Reports_NET__Perfect_Excel_Exports.all#Page1
t
jitendra2coo...
Member
27 Points
54 Posts
Re: How to export Crystal Report data to a MS Excel format?
Mar 13, 2012 12:38 PM|LINK
Hi peter cong,
you can refer foll. site
http://www.highoncoding.com/Articles/553_Export_Crystal_Reports_to_Different_File_Formats.aspx
Hope it can solve your query.
Thanks
t
narasappa
Participant
960 Points
459 Posts
Re: How to export Crystal Report data to a MS Excel format?
Mar 13, 2012 01:24 PM|LINK
Hope t
ravi.jadiyannavar@gmail.com
Pls Mark This Post As Answer If it Helps U..
Thanku
Peter Cong
Member
527 Points
681 Posts
Re: How to export Crystal Report data to a MS Excel format?
Mar 13, 2012 05:48 PM|LINK
Hi, Thanks a lot for the help,
Crystal report(2008) has a built in function to export to MS Excel, it can export to two kinds of format:
1. MS (97-2003)(*.xls), this format is good (the title is generated), but it generates a lot of blank columns in the report, which is hard to read by a program. As the exported MS Report is not only for reading by user, it also used to be read by a program. So, those blank columns will generate errors.
2. MS Excel(97-2003) Data-Only (*.xls): the column data in Crystal report are exported properly (it is good to be read by a program), but the Title and footer are missing.
So what I want is to combine these two report together, which has title and footer and column data generated properly (no empty columns).
I appraciate anybody can provide some good examples to achieve my goal, thanks a lot.
Peter Cong
Member
527 Points
681 Posts
Re: How to export Crystal Report data to a MS Excel format?
Mar 13, 2012 05:50 PM|LINK
Hi, Thanks a lot for the help,
Crystal report(2008) has a built in function to export to MS Excel, it can export to two kinds of format:
1. MS (97-2003)(*.xls), this format is good (the title is generated), but it generates a lot of blank columns in the report, which is hard to read by a program. As the exported MS Report is not only for reading by user, it also used to be read by a program. So, those blank columns will generate errors.
2. MS Excel(97-2003) Data-Only (*.xls): the column data in Crystal report are exported properly (it is good to be read by a program), but the Title and footer are missing.
So what I want is to combine these two report together, which has title and footer and column data generated properly (no empty columns).
I appraciate anybody can provide some good examples to achieve my goal, thanks a lot.
t