Export and customize a crystal report in excel

0 votes
asked Sep 20, 2010 by mohs

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?

3 Answers

0 votes
answered Sep 20, 2010 by edward-leno

If you are finding empty rows between your data, you can filter these out in Excel:

  • Select column
  • Data > Filter (Excel 2010)
  • Dropdown > uncheck 'Blanks'

I don't use Crystal Reports, but could you export to a CSV file, then import into Excel. The import will allow you to specify the delimiters and should format your data better.

0 votes
answered Sep 21, 2010 by poweruser

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.

0 votes
answered Sep 21, 2010 by mark-bannister

From experience with exporting from older versions of Crystal to Excel, a couple of options:

(1) Export to CSV and open the CSV file in Excel.

This had the disadvantage that instead of appearing at the top of the report above the data values, the column headings would appear on every line of the output before the column values - like so:

No   Trans_No   1   123
No   Trans_No   2   333

This issue may have been resolved in CR XI - if not, the workround we used for this was to suppress column headings (so that only the values were included in the output), then copy and paste a standard spreadsheet heading for the report into the output in Excel.

(2) Consistently format all fields to the same, minimum size (typically, two grid widths), with columns aligned by snapping the left edge of fields to guidelines.

This produces output which is almost unreadable in the standard report viewer, but which should align correctly in Excel.

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter

...