水晶报表 - 如果包含图表,则数据重复

发布于 2024-12-06 03:32:02 字数 554 浏览 0 评论 0原文

我们使用 Crystal Reports XI R3 来实现报告目的。我们创建了类型化数据集作为报告的数据源。

我面临的问题包括其中一份报告上的条形图和网格。默认情况下,图表嵌入到标题部分,网格是从详细信息部分生成的。

如果我设计没有图表的报告,一切都很好。如果我提供 8 行数据,它也会在报告中发布 8 行。但是,如果我在同一个报告中包含图表,详细信息部分中的数据就会成倍增加,并且我会得到 64 行或具有相同数据源的数据。

这应该是一个非常简单的功能,但它似乎对我不起作用。我尝试包含一个子报告并在子报告中包含详细信息部分,它工作正常。但是,我也不能采用这种方法,因为该报告本身将作为子报告包含在另一个报告中,并且我们不能在 Crystal 中嵌套子报告。

请帮助我指出可能出现什么问题?

编辑:经过进一步调查,使用两个不同的表格来填充图表和网格似乎存在问题。如果我对两者都使用一个表,则效果很好。

应@Kalyan 的请求附上屏幕截图: 在此处输入图像描述

We are using Crystal Reports XI R3 for our reporting purposes. We have created typed dataset which act as the datasource for the reports.

I am facing an issue including a bar chart along with the grid on one of the reports. The chart gets embedded into the header section by default and the grid is generated out of the details section.

If I design the report without the chart, it all works fine. If I supply 8 rows of data, it publishes 8 rows in the report too. But if I include a chart on the same report, the data in the details section gets multiplied, and I get 64 rows or something with the same datasource.

This should be a pretty straight forward functionality, but it doesn't seem to be working for me. I tried include a sub-report and have the details section in the sub-report and it works fine. But, I can't go with this approach either as this report in itself would be included to another as a sub-report and we cant have nested sub-reports in Crystal.

Please help me with some pointers on what could be going wrong ?

Edit: On further investigation, it looks like a problem with having two different tables to populate the chart and the grid. If I use a single table for both, it works fine.

Attaching screenshot on @Kalyan's request:
enter image description here

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

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

发布评论

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

评论(1

枯叶蝶 2024-12-13 03:32:02

问题确实是在单个报告中使用多个不相关的表。默认情况下,Crystal Reports 不允许使用多个表,除非它们以某种方式链接。如果您不指定链接,它会尝试自行应用链接并在发布报表时运行联接。

由于这种加入,数据对我来说不断重复。

为了解决这个问题,我在网格对应的表的主键上创建了一个组,并使用该组生成网格并抑制了详细信息部分。问题解决了。

The issue indeed was with using multiple unrelated tables for a single report. Crystal Reports by default doesn't allow using multiple tables, unless they are linked in someway. If you dont specify a link, it tries to apply a link on its own and runs a join while publishing the report.

Due to this join, the data was getting repeated for me.

To resolve the issue, I created a group on the primary key of the table corresponding to the grid, and used the group to generate the grid and suppressed the details section. Problem resolved.

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