使用 Can Grow 将水晶报表导出到 Excel

发布于 2024-09-14 12:55:02 字数 1414 浏览 10 评论 0原文

我正在使用 Crystal Reports 2008、带有 C# 的 Visual Studio 2008。我用 Crystal 构建了包含多个专栏的报告,其中一些是叙述性的,并且可能相当冗长。 “Can Grow”适用于各个领域。

我还有一个通过查看器显示报告的网页,看起来很棒:

Web Page / Crystal Viewer
Date            Narrative                                     Region
08/16/2010      It was a rough day for several Chase          USA
                contenders. Kurt Busch blew an engine, 
                Mark Martin damaged his car early and 
                spent most of the afternoon running 
                outside the top 30, and Jeff Gordon was in 
                the top 10 then he had a flat tire with 47 
                laps to go.

Excel 输出示例:

ROW
1 Date          Narrative                                    Region
2 08/16/2010    It was a rough day for several Chase         USA
3               contenders. Kurt Busch blew an engine, 
4               Mark Martin damaged his car early and 
5               spent most of the afternoon running 
6               outside the top 30, and Jeff Gordon was in 
7               the top 10 then he had a flat tire with 47 
8               laps to go.

当客户端导出到 Excel 时出现问题:“可以增长”叙述列变成多行,而不是我需要的单行。

由于叙述位于多行中,该报告无法排序。 我可以通过“仅数据”选项将其导出到 Excel,但需要用户操作才能读取。

有人知道我怎样才能做到这一点吗?我知道 Crystal Export to Excel 无法做到这一点。

我是 SQL/Crystal 开发人员,对其中的 Web/C# 部分知之甚少。我可以通过 C# 导出到模板吗?或者有一些第三方软件可以完成这个任务吗?

I'm using Crystal Reports 2008, Visual Studio 2008 with C#. I build the report in Crystal with multiple columns, some of which are narrative and can be quite lengthy. “Can Grow” is on for every field.

I also have a web page that displays the report through the viewer, which looks great:

Web Page / Crystal Viewer
Date            Narrative                                     Region
08/16/2010      It was a rough day for several Chase          USA
                contenders. Kurt Busch blew an engine, 
                Mark Martin damaged his car early and 
                spent most of the afternoon running 
                outside the top 30, and Jeff Gordon was in 
                the top 10 then he had a flat tire with 47 
                laps to go.

Example of Excel Output:

ROW
1 Date          Narrative                                    Region
2 08/16/2010    It was a rough day for several Chase         USA
3               contenders. Kurt Busch blew an engine, 
4               Mark Martin damaged his car early and 
5               spent most of the afternoon running 
6               outside the top 30, and Jeff Gordon was in 
7               the top 10 then he had a flat tire with 47 
8               laps to go.

The problem occurs when clients export to Excel: The “Can Grow” narrative columns become multiple rows, not the single Row that I need.

The report isn't sortable due to the Narrative being in Multiple Rows.
I can export it into Excel through the “Data Only” option, but then it requires user manipulation before it is readable.

Anybody know how I can accomplish this? I know that the Crystal Export to Excel isn’t going to do it.

I am the SQL / Crystal Developer and know very little about the Web/C# portion of this. Can I export to an Template through C#? Or is there some 3rd-party software that will accomplish this?

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

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

发布评论

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

评论(2

得不到的就毁灭 2024-09-21 12:55:02

我也有同样的问题。可能包含回车符的一列,例如:

“- text 1
- 文本 2
- text 3"

我已使用 Mark 的建议并尝试替换回车符。

我使用以下公式代替单元格值:
替换({cell}, "\n", " ");

当我将报告导出到 Excel(使用 Excel,而不仅仅是 Excel 数据)时,效果非常好。

我本来希望显示诸如“- text1 - text 2 - text 3”之类的内容(按照上面的示例)。然而,它甚至更好:如果我在 Excel 中选择列并启用自动换行功能,它会正确显示内容:

“- text 1
- 文本 2
- 文本 3"

水晶字段没有选中“可以生长”单选按钮。这将导致报告不显示所有行。不过,可以导出到 Excel。

I had the same problem. One column that may contain carriage return characters such as:

"- text 1
- text 2
- text 3"

I have used Mark's suggestion and tried to replace the carriage return.

Instead of the cell value, I used the following formula:
Replace ({cell}, "\n", " ");

When I export the report to Excel (using Excel, and not Excel data only), it works very well.

I would have expected to display the content such as "- text1 - text 2 - text 3" (following the example above). However it is even better: if I select the columns in Excel and enable the Wrap text feature it displays the content correctly:

"- text 1
- text 2
- text 3"

The Crystal field does not have the Can grow radio button checked. This will cause the report not to display all the rows. The export to Excel will work, though.

薯片软お妹 2024-09-21 12:55:02

假设“叙述”字段是单个数据集行,由于该字段中存在回车符,该行正在导出到多个 Excel 行,您是否尝试过替换该字段中的回车符?

Assuming the Narrative field is a single dataset row that is being exported to multiple Excel rows due to carriage returns in the field, have you tried substituting the carriage return characters in the field?

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