水晶报表组计数

发布于 2024-12-01 02:39:42 字数 569 浏览 1 评论 0原文

假设我在数据集中有这些记录:

name1        XXXXX           XXXXXX 
name1        XXXXX           XXXXXX 
name1        XXXXX           XXXXXX 
name2        XXXXX           XXXXXX 
name2        XXXXX           XXXXXX 
name2        XXXXX           XXXXXX 
name2        XXXXX           XXXXXX 

我想创建一个报告,在其中可以看到每个名称中记录的总和/计数:

name1      3
name2      4

如何实现此输出?此外,是否可以通过查询在水晶报表中分配绑定字段?例如:

select name, count(name) as [Count] from tbname  group by name

如何获取 Count 字段? (如果它确实不是表中的字段)?

Lets say that I have this records in a dataset:

name1        XXXXX           XXXXXX 
name1        XXXXX           XXXXXX 
name1        XXXXX           XXXXXX 
name2        XXXXX           XXXXXX 
name2        XXXXX           XXXXXX 
name2        XXXXX           XXXXXX 
name2        XXXXX           XXXXXX 

I want to create a report where i can see the sum/count of records in each names:

name1      3
name2      4

How can I achieve this output? Additionally, is it possible to assign a bound field in a crystal report from a query? For example:

select name, count(name) as [Count] from tbname  group by name

How can I get the Count field? (if it's really not a field in a table)?

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

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

发布评论

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

评论(2

星星的轨迹 2024-12-08 02:39:42

如果你去插入->概括。从那里您可以选择要求和的字段。然后在“计算字段”下选择计数。 “摘要位置”由您决定,我更喜欢将其放在组下(如果我有的话)。当您查看详细信息页面时,您将看到一个新的“字段”或框,其中将包含您的信息。如果您还想获得总计,您可以将该框复制并粘贴到报告页脚中,CR 会自动为您添加所有内容。

另外,假设您只想查看总数,不想看到所有其他内容:右键单击您不想看到的字段 ->格式字段->常见->单击“抑制”。这样你就看不到这些信息,但它仍然存在供 CR 计算。

至于为该框放置参数,它可以像字段一样填充为选项。我不确定,从未尝试过。希望这有帮助!

If you go to insert -> summary. From there you can select which field you want a sum for. Then under "Calculate Field" select count. The "Summary Location" is up to you, I prefer to put it under the group (if I have one). When you see your details page, you will see a new "field" or box that will contain your information. If you would like to also have a grand total, you can copy and paste that box into the report footer and CR will automatically add them all up for you.

Also, say you want to just see the total, you don't want to see all the other stuff: right click the field you don't want to see -> Format Field -> Common -> click Suppress. That way you wont see the information, but its still there for CR to calculate.

As for putting a parameter for that box, it may populate as a choice as the fields do. I'm not sure, never tried it. Hope this was helpful!

森末i 2024-12-08 02:39:42

u 尝试插入组(table.name),然后插入摘要并选择要摘要的字段,然后选择“非重复计数”以在页脚中计算此摘要。

u try insert goup for (table.name) and then insert summary and choose the field to summarize, and then choose Distinct Count to calculate this summary in the footer.

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