找回密码
 立即注册

QQ登录

只需一步,快速开始

zhaorong

注册会员

5

主题

44

帖子

115

积分

注册会员

积分
115
最新发帖
zhaorong
注册会员   /  发表于:2021-4-26 09:50  /   查看:2986  /  回复:9
本帖最后由 Crystal.Li 于 2021-4-26 11:03 编辑

报表服务升级到 dotnet core 版本之后导出Excel出现两个比较奇怪的问题:
1、点击报表界面导出按钮,有时候会出现404错误,Url地址为:https://[域名]/api/reporting/export/[exportId]/print
2、在不出现404错误的情况下,弹出下载保存文件窗口,文件名显示不正常,如图所示:


PS:
1、停用负载均衡之后404错误消失。
2、在浏览器直接打开生成的Url地址,文件名显示正常。
3、前端页面是托管到Aws S3的,本地部署之后通过nginx转发不会出现此问题。
4、文件是存储到AWS S3的。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

9 个回复

倒序浏览
Crystal.Li讲师达人认证 悬赏达人认证
论坛元老   /  发表于:2021-4-26 11:03:39
沙发
您好,您和这位同学提了同样的问题:https://gcdn.grapecity.com.cn/fo ... &extra=page%3D1
不知是不是同事,但问题点都是一样的,我们需要找研发同事调查一下该问题,寻找一下解决方案,还请您耐心等待一下,有结果第一时间回复您!
回复 使用道具 举报
zhaorong
注册会员   /  发表于:2021-4-26 13:19:54
板凳
404的问题我们暂时停用了一台服务器临时处理了,现在比较着急的是文件名的问题。
回复 使用道具 举报
Crystal.Li讲师达人认证 悬赏达人认证
论坛元老   /  发表于:2021-4-26 13:43:06
地板
您好,文件名的问题我们这边没有复现。
通过截图不太能看出来,请问下您这个文件名不正确指的是文件名被转义了吗?另外您用的是什么浏览器? 这个问题在任何机器上都会复现吗?
回复 使用道具 举报
zhaorong
注册会员   /  发表于:2021-4-26 14:37:59
5#
报表界面点击导出按钮下载文件的时候没有正确显示文件名称,而是简单的使用了Url里面的一段参数作为文件名。
浏览器用的是Chrome,我们这边两个团队都遇到这个问题。
我们的前端页面是托管在S3的。
回复 使用道具 举报
Crystal.Li讲师达人认证 悬赏达人认证
论坛元老   /  发表于:2021-4-26 14:47:40
6#
关于 ”Url里面的一段参数“ 可否详细说明? 有没有截图, 我们看看是什么参数
回复 使用道具 举报
zhaorong
注册会员   /  发表于:2021-4-26 14:58:16
7#
弹出窗口显示的文件名:
%7B%22FileName%22_%22PurchaseOrderSummaryRpt.rdlx%22,%22Api%22_%22_api_purchase_order_table_summary_print%22,%22JsonArgs%22_%22%7B%5C%22DistributorContractIds%5C%22_%5B%5D,%5C%22OrgIds%5C%22_%5B%5D,%5C%22BranchIds%5C%22_%5B%5D,%5C%22Distribut.oW19g8CUV5yT.ow19g8cuv5yt3rlyyvbwhezphwfk5p7myqkfvib_5cee1ic4wkxtclifsd9bn5uujlap6odqpgcffq8pmnn12esbce3vmgwacnwgw42ldsvulgf3plo3ij7a6zuylprqthba-wxkxlyaielaxf1k-lvrnzadeif1xoelzjbubtwoi6wx8c7sbcm9-ffffq2xeedbnreoiivwkhrfoig_qtcvjz1rmsowfvkxoahbgdzcqfdcdozowlz8zkngwdil0_vu8eqh3u4rffpig50wo3ctkdskd15svus-dwuivhkiri99shlw7rozpmv9tjjrrm1pvuna3wpmirhml1ptma%22%7d

URL地址:
https://..../api/reporting/export/%20myf-IJ0Oke%20RiFD78nqug/print%22,%22JsonArgs%22:%22%7B%5C%22DistributorContractIds%5C%22:%5B%5D,%5C%22OrgIds%5C%22:%5B%5D,%5C%22BranchIds%5C%22:%5B%5D,%5C%22DistributorIds%5C%22:%5B%5D,%5C%22SuppIds%5C%22:%5B%5D,%5C%22SuppStatusList%5C%22:%5B%5D,%5C%22BusinessLineIds%5C%22:%5B%5D,%5C%22SaleOrgIdList%5C%22:%5B%5D,%5C%22ProdLineIds%5C%22:%5B%5D,%5C%22ProdBrandIds%5C%22:%5B%5D,%5C%22ProdCategoryIds%5C%22:%5B%5D,%5C%22ProdBreedIds%5C%22:%5B%5D,%5C%22ProdIds%5C%22:%5B%5D,%5C%22BillTypeSubIds%5C%22:%5B%5D,%5C%22BillStatus%5C%22:%5B%5C%223%5C%22,%5C%224%5C%22,%5C%225%5C%22,%5C%226%5C%22%5D,%5C%22UnitType%5C%22:1,%5C%22BillTypeIds%5C%22:%5B1%5D%7D%22,%22Token%22:%22ey
回复 使用道具 举报
Crystal.Li讲师达人认证 悬赏达人认证
论坛元老   /  发表于:2021-4-26 15:52:17
8#
您好,您这个报表看起来是设置了报表参数,我将您发的这个url解码了一下:

您这边对请求报表的url有做过什么处理吗?这个url地址看起来不太正确。

正常而言,我们设置报表参数,url有中文就会编码,解码之后后面显示的就是报表文件的名称,不会出现您这里提供的JsonArgs, 这个print也很奇怪

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
zhaorong
注册会员   /  发表于:2021-4-26 17:22:59
9#
我们没有专门配置这个接口的参数,我把从查询请求到最后导出的参数都贴出来吧

https://[域名]/api/reporting/reports/%7B%22FileName%22:%22PurchaseOrderSummaryRpt.rdlx%22,%22Api%22:%22%252Fapi%252Fpurchase%252Forder%252Ftable%252Fsummary%252Fprint%22,%22JsonArgs%22:%22%7B%5C%22DistributorContractIds%5C%22:%5B%5D,%5C%22OrgIds%5C%22:%5B%5D,%5C%22BranchIds%5C%22:%5B%5D,%5C%22DistributorIds%5C%22:%5B%5D,%5C%22SuppIds%5C%22:%5B%5D,%5C%22SuppStatusList%5C%22:%5B%5D,%5C%22BusinessLineIds%5C%22:%5B%5D,%5C%22SaleOrgIdList%5C%22:%5B%5D,%5C%22ProdLineIds%5C%22:%5B%5D,%5C%22ProdBrandIds%5C%22:%5B%5D,%5C%22ProdCategoryIds%5C%22:%5B%5D,%5C%22ProdBreedIds%5C%22:%5B%5D,%5C%22ProdIds%5C%22:%5B%5D,%5C%22BillTypeSubIds%5C%22:%5B%5D,%5C%22BillStatus%5C%22:%5B%5C%223%5C%22,%5C%224%5C%22,%5C%225%5C%22,%5C%226%5C%22%5D,%5C%22UnitType%5C%22:1,%5C%22BillTypeIds%5C%22:%5B1%5D%7D%22,%22Token%22:%22[TOKEN]%22%7D/info

https://[域名]/api/reporting/reports/%7B%22FileName%22:%22PurchaseOrderSummaryRpt.rdlx%22,%22Api%22:%22%252Fapi%252Fpurchase%252Forder%252Ftable%252Fsummary%252Fprint%22,%22JsonArgs%22:%22%7B%5C%22DistributorContractIds%5C%22:%5B%5D,%5C%22OrgIds%5C%22:%5B%5D,%5C%22BranchIds%5C%22:%5B%5D,%5C%22DistributorIds%5C%22:%5B%5D,%5C%22SuppIds%5C%22:%5B%5D,%5C%22SuppStatusList%5C%22:%5B%5D,%5C%22BusinessLineIds%5C%22:%5B%5D,%5C%22SaleOrgIdList%5C%22:%5B%5D,%5C%22ProdLineIds%5C%22:%5B%5D,%5C%22ProdBrandIds%5C%22:%5B%5D,%5C%22ProdCategoryIds%5C%22:%5B%5D,%5C%22ProdBreedIds%5C%22:%5B%5D,%5C%22ProdIds%5C%22:%5B%5D,%5C%22BillTypeSubIds%5C%22:%5B%5D,%5C%22BillStatus%5C%22:%5B%5C%223%5C%22,%5C%224%5C%22,%5C%225%5C%22,%5C%226%5C%22%5D,%5C%22UnitType%5C%22:1,%5C%22BillTypeIds%5C%22:%5B1%5D%7D%22,%22Token%22:%22[TOKEN]%22%7D/render

https://[域名]/api/reporting/session/yq4dBNcqKEK4OJIxRJR%20nQ/export/Xls

https://[域名]/api/reporting/export/RaM3SnlRBESzOE1OM6vF8w/print%22,%22JsonArgs%22:%22%7B%5C%22DistributorContractIds%5C%22:%5B%5D,%5C%22OrgIds%5C%22:%5B%5D,%5C%22BranchIds%5C%22:%5B%5D,%5C%22DistributorIds%5C%22:%5B%5D,%5C%22SuppIds%5C%22:%5B%5D,%5C%22SuppStatusList%5C%22:%5B%5D,%5C%22BusinessLineIds%5C%22:%5B%5D,%5C%22SaleOrgIdList%5C%22:%5B%5D,%5C%22ProdLineIds%5C%22:%5B%5D,%5C%22ProdBrandIds%5C%22:%5B%5D,%5C%22ProdCategoryIds%5C%22:%5B%5D,%5C%22ProdBreedIds%5C%22:%5B%5D,%5C%22ProdIds%5C%22:%5B%5D,%5C%22BillTypeSubIds%5C%22:%5B%5D,%5C%22BillStatus%5C%22:%5B%5C%223%5C%22,%5C%224%5C%22,%5C%225%5C%22,%5C%226%5C%22%5D,%5C%22UnitType%5C%22:1,%5C%22BillTypeIds%5C%22:%5B1%5D%7D%22,%22Token%22:%22eyJhbGciOiJSUzI1NiIsImtpZCI6IjUyYTMwZmFjMmFjNzhjNTUiLCJ0eXAiOiJhdCtqd3QifQ_eyJuYmYiOjE2MTk0MjgzNjgsImV4cCI6MTYxOTUxNDc2OCwiaXNzIjoiaHR0cHM6Ly9rZHNhMS1hcGkud2lsbWFyLmNuIiwiYXVkIjoiS2RzQTEiLCJjbGllbnRfaWQiOiJrZHMtYTEtY2xpZW50Iiwic3ViIjoiMTIxMDAxMjAyOSIsImF1dGhfdGltZSI6MTYxOTQyODM2OCwiaWRwIjoibG9jYWwiLCJjb21wYW55aWQiOiIxMjEwMjE3NTI0IiwiY29tcGFueXNpZCI6IjEyMTAyMTc1MjQiLCJzc29uYW1lIjoiMjE3NTI0IiwiYWNjb3VudCI6IjIxNzUyNCIsImlzYWRtaW4iOiJUcnVlIiwiYmVsb25nX3R5cGUiOiIyIiwiZW1wbG95ZWVfaWQiOiIwIiwidGVuYW50aWQiOiIwNWE2NTIxMS0zZDcyLTQzMzktOWFkYy04NDUxNTFmOGFkYTAiLCJzY29wZSI6WyJLZHNBMSIsIm9mZmxpbmVfYWNjZXNzIl0sImFtciI6WyJwd2QiXX0

没有人为干预过代码执行过程,但是最后一个下载文件的请求,Token被截断。
回复 使用道具 举报
Crystal.Li讲师达人认证 悬赏达人认证
论坛元老   /  发表于:2021-4-26 18:18:57
10#
您好,
您这个print是从哪里来的:

token被截断是因为URL有长度限制,超过一定长度就会不显示。

我们正常的导出流程有这么三个api:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部