JasperReports 交叉表查询
我使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对此进行后续跟进。
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.