Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / CrystalReports

Export Crystal Report to Excel - Some Tips

5.00/5 (1 vote)
19 Aug 2014CPOL1 min read 15K  
Tips for developing a Crystal report which will be exported to Excel

Introduction

Developing a Crystal report which will be exported into Excel is always tricky, time consuming and needs a lot of patience. There are a lot of blog posts, forum discussions, articles in the web about this matter. During the last couple of days, I was hanging with one of my reports and at last I've figured out some tricks about exporting Crystal report to Excel.

Some Tricks

  1. Do not use your mouse to resize/align your header/detail fields. Always depend on Properties pane. Make sure the height, width and left properties are always the same as that of the related header and detail fields.
  2. Top property of header/detail fields should always be 0.
  3. Do not use line object. It will create an extra Excel row after export.
  4. You can use (single) right and bottom border of detail field objects and only right border of header objects.
  5. May be the report which will export to Excel will not be presentable for clients. So create another presentable report for client which may have lines or borders or colors or whatever you want.
  6. After exporting into Excel - maybe your header or detail section will be created using more than one Excel rows. This may not be a problem. But you can decrease the height of detail/header fields to accommodate in single Excel row.
  7. Suppress (Drill Down) the report header, report footer, page header, page footer because they do not have value in Excel.
  8. In your data source, do not keep null data in any field. Atleast, fill data with empty string/something not valuable like dash (-).

May be these tricks will help you.

Happy coding!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)