Export and customize a crystal report in excel

mohs picture mohs · Sep 20, 2010 · Viewed 28.7k times · Source

I am having an issue is that while exporting a report to excel sheet, there are lots of spaces and empty cells between the data, as well as, the cells are merged.

Is there is a way to export the report and each field will be in a cell or to control that exportation, suppose my report looks like this:

No  Trans_No 
1    123
2    333

In my excel sheet, I would like

A    B
No  Trans_No 
1    123
2    333

, But currently it is showing a merging of the cells and spaces , so instead of Trans_No will be in CELL B, it is in D.

So, is there is a way to control o export that?

Answer

PowerUser picture PowerUser · Sep 21, 2010

mohs, welcome to StackOverflow.

Crystal Reports and Excel have very different methods and data structures. When exporting a .rpt into .xls format, Crystal has to make many compromises and judgement calls. Here are some suggestions:

  1. Do you absolutely need to use Crystal in this process?

    A. You can import data directly from your data source into Excel (without using Crystal) using Data->Import External Data.
    B. You can export from Crystal into CSV format. If the Excel file is being made just for a machine to read it, CSV is a better option.

  2. Keep your Crystal Report very simple.

    A. After you drag & drop fields onto your design, do not resize or overlap them.
    B. Make sure in your options, you have snap to grid checked.
    C. Are your fields horizontally aligned? If not, they will probably be put on different rows.
    D. If you are grouping data, you may want to suppress the group headers & footers.