Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

主子表导出excel,报空指针异常,导出数据为空。 #2945

Closed
blanset opened this issue Sep 3, 2024 · 5 comments
Closed

主子表导出excel,报空指针异常,导出数据为空。 #2945

blanset opened this issue Sep 3, 2024 · 5 comments

Comments

@blanset
Copy link

blanset commented Sep 3, 2024

版本号:1.8.0
问题描述:主子表查询后,导出的excel中报错{"msg":null,"code":500}。后台日志报错 请求地址'/report/jmreport/exportAllExcelStream',发生未知异常.

java.lang.NullPointerException: null
at org.jeecg.modules.jmreport.desreport.render.a.d.a(TableMultiDsRenderStrategy.java:143)
at org.jeecg.modules.jmreport.desreport.render.a.e.a(TableRenderStrategy.java:98)
at org.jeecg.modules.jmreport.desreport.render.a.a.b.a(BaseBaseRenderStrategy.java:385)
at org.jeecg.modules.jmreport.desreport.render.a.a.b.b(BaseBaseRenderStrategy.java:264)

错误日志&截图:

image

重现步骤:

主表sql:

SELECT
	oir.dispatchTaskId
FROM
	`order` oir
	LEFT JOIN order_task ot ON ot.order_id = oir.id 
GROUP BY
	oir.dispatchTaskId

子表sql:

SELECT
	CASE WHEN charge IS NULL THEN 0
	ELSE charge
	END as charge
FROM
(
	SELECT
                       dt.orderStates
	FROM
			e_dispatch_task dt
			LEFT JOIN e_emr e ON e.dispatchTaskId = dt.dispatchTaskId
			LEFT JOIN e_emr_order eo ON eo.emrId = e.emrId
	WHERE
			dt.dispatchTaskId = '${dispatchTaskId}'
) t

主子表参数连结:
主表的dispatchTaskId和子表dispatchTaskId连结。

两张表分别来自两个源的数据库。

导出excel文件没有内容,后台报空指针异常。

友情提示(为了提高issue处理效率):

  • 积木报表是一款免费报表产品,功能免费源码不开放;
  • 未按格式要求发帖,会被直接删掉;
  • 请针对问题提供[报表设计配置或SQL脚本]或在官网制作报表示例并提供ID;
  • 针对不好重现的问题,请录制操作视频或详细的重现步骤;
@blanset
Copy link
Author

blanset commented Sep 3, 2024

子表sql写错重新写下,发的时候写错了变量。

子表sql:

SELECT
	CASE WHEN charge IS NULL THEN 0
	ELSE charge
	END as charge
FROM
(
	SELECT
                       dt.charge
	FROM
			e_dispatch_task dt
			LEFT JOIN e_emr e ON e.dispatchTaskId = dt.dispatchTaskId
			LEFT JOIN e_emr_order eo ON eo.emrId = e.emrId
	WHERE
			dt.dispatchTaskId = '${dispatchTaskId}'
) t

@blanset
Copy link
Author

blanset commented Sep 3, 2024

主表字段与子表字段:

image

@zhangdaiscott
Copy link
Member

请针对问题提供[报表设计配置或SQL脚本]或在官网制作报表示例并提供ID;

@jeecgos
Copy link
Collaborator

jeecgos commented Sep 20, 2024

cr

@hoperunChen
Copy link

已修复,待新版本发布。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants