在 Excel 中导出和自定义水晶报表

发布于 2024-09-24 16:41:04 字数 352 浏览 2 评论 0原文

我遇到的问题是,在将报告导出到 Excel 工作表时,数据之间存在大量空格和空单元格,并且单元格被合并。

有没有一种方法可以导出报告并且每个字段都在一个单元格中或控制该导出,假设我的报告如下所示:

No  Trans_No 
1    123
2    333

在我的 Excel 工作表中,我希望

A    B
No  Trans_No 
1    123
2    333

,但目前它显示单元格的合并和space ,所以 Trans_No 不会在 CELL B 中,而是在 D 中。

那么,有没有办法控制 o 导出呢?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

那伤。 2024-10-01 16:41:04

mohs,欢迎来到 StackOverflow。

Crystal Reports 和 Excel 有非常不同的方法和数据结构。将 .rpt 导出为 .xls 格式时,Crystal 必须做出许多妥协和判断。以下是一些建议:

  1. 在此过程中您绝对需要使用 Crystal 吗?

    A.您可以使用数据->导入外部数据将数据直接从数据源导入到 Excel(无需使用 Crystal)。
    B. 您可以从 Crystal 导出为 CSV 格式。如果 Excel 文件只是为了让机器读取,那么 CSV 是更好的选择。

  2. 让您的 Crystal Report 保持简单。

    A.拖动后,将字段拖放到您的设计中,不要调整它们的大小或重叠它们。
    B. 确保在您的选项中,您已选中对齐网格
    C. 您的字段是否水平对齐?如果没有,它们可能会被放在不同的行上。
    D. 如果您正在对数据进行分组,您可能需要隐藏组标题和组标题。

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.

心凉怎暖 2024-10-01 16:41:04

如果您发现数据之间有空行,您可以在 Excel 中过滤掉这些空行:

  • 选择列
  • “数据”>“过滤器 (Excel 2010)
  • 下拉菜单 >取消选中“空白”

我不使用 Crystal Reports,但您可以导出到 CSV 文件,然后导入到 Excel 中吗?导入将允许您指定分隔符并且应该更好地格式化您的数据。

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.

神魇的王 2024-10-01 16:41:04

根据从旧版本 Crystal 导出到 Excel 的经验,有几个选项:

(1) 导出到 CSV 并在 Excel 中打开 CSV 文件。

这样做的缺点是,列标题不是出现在数据值上方的报告顶部,而是出现在输出的每一行列值之前 - 就像这样:

No   Trans_No   1   123
No   Trans_No   2   333

此问题可能已在 CR XI 中解决 - 如果没有,我们为此使用的解决方法是隐藏列标题(以便只有值包含在输出中),然后将报告的标准电子表格标题复制并粘贴到 Excel 的输出中。

(2) 将所有字段的格式一致设置为相同的最小大小(通常为两个网格宽度),并通过将字段的左边缘与参考线对齐来对齐列。

这会产生在标准报表查看器中几乎无法读取的输出,但在 Excel 中应该正确对齐。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文