水晶报表 - 如果包括图表,则重复数据 [英] Crystal Reports - Data repeating if chart is included

查看:441
本文介绍了水晶报表 - 如果包括图表,则重复数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Crystal Reports XI R3进行报告。我们创建了类型化的数据集,作为报表的数据源。



我面临着一个问题,包括一个条形图以及其中一个报表上的网格。默认情况下,图表嵌入到标题部分,网格将在详细信息部分生成。



如果我设计的报表没有图表,一切正常。如果我提供8行数据,它也在报表中发布8行。但是,如果我在同一个报表中包含一个图表,详细信息部分的数据会相乘,我得到64行或者具有相同数据源的东西。



这应该是一个非常直接的功能,但它似乎并不适用于我。我试过包括一个子报告,并在分报告中的细节部分,它工作正常。但是,我不能使用这种方法,因为这个报告本身将被包括到另一个作为子报告,我们不能在Crystal中嵌套子报告。



<

编辑:在进一步调查时,它看起来像一个问题:两个不同的表来填充图表和网格。



在@ Kalyan的请求中附加屏幕截图:

解决方案

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



由于这次加入,我的资料被重复。



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


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:

解决方案

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.

这篇关于水晶报表 - 如果包括图表,则重复数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆