JasperReports 交叉表查询

发布于 2024-07-14 17:18:25 字数 533 浏览 15 评论 0原文

我使用 JasperReports \ iReport 交叉表来创建学生和结果的矩阵。

例如,Jim 正在做主题 A、B、C,Sally 正在做 A、C

我想要的是这样的:

        Subj-A   Subj-B   Subj-C
Jim          P        M        D
Sally        D                 D 

但是当我的 SQL 按名称排序时,我得到的主题是:

        Subj-A   Subj-B   Subj-C   Subj-A   Subj-C
Jim          P        M        D        
Sally                                   D        D

正如您在上面看到的,结果是正确的,但是格式很糟糕。 无论如何,我是否可以生成仅使用名称和主题一次的报告 并从这里填写值?

I'm using JasperReports \ iReport crosstabs to create a matrix of student and results.

So for example Jim is doing subjects A, B, C and Sally is doing A, C

What I want is something like:

        Subj-A   Subj-B   Subj-C
Jim          P        M        D
Sally        D                 D 

But as my SQL orders by name then subject I get:

        Subj-A   Subj-B   Subj-C   Subj-A   Subj-C
Jim          P        M        D        
Sally                                   D        D

As you can see in the above the results are correct but the formatting is woeful.
Is there anyway I can generate the reports to use names and subject only once
and filling in the values from here?

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

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

发布评论

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

评论(1

旧竹 2024-07-21 17:18:25

对此进行后续跟进。

JasperReports 主要用于表示数据,因此这里的工作需要通过 SQL 完成。

在存在 X 与 Y 交叉表的情况下,我们可能需要使用交叉联接,它实际上计算 X 科目和 Y 学生的所有组合。

交叉连接后,我们可以对候选详细信息使用外连接来查找结果。 此后,这是贾斯珀代表的基本问题。

To follow-up on this.

JasperReports is primarily used to represent the data so the work here needs to be done here via the SQL.

In a case where there is a crosstab of X vs Y we may need to use a cross-join which bacically compute all the combination of X subject and Y students.

After the cross-join we can use an outer-join on the candidate details to find there results. After this it is a basic matter of representation in Jasper.

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