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
- 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.
- Top property of header/detail fields should always be 0.
- Do not use line object. It will create an extra Excel row after export.
- You can use (single) right and bottom border of detail field objects and only right border of header objects.
- 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.
- 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.
- Suppress (Drill Down) the report header, report footer, page header, page footer because they do not have value in Excel.
- 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!