ReportViewer“导出到Excel"在百分比值上加上小数.我该如何覆盖呢? [英] ReportViewer "Export to Excel" adds decimal to percentage values. How can I override this?

查看:109
本文介绍了ReportViewer“导出到Excel"在百分比值上加上小数.我该如何覆盖呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在aspx页面上有一个ReportViewer控件,该控件呈现一个漂亮的报告,其中一列为百分比.我已经将单元格的格式设置为p0,并且工作正常.将报告导出为ex​​cel的用户会注意到,该值后面会出现一个小数.

I have a ReportViewer control on my aspx page that renders a nice report with one of the columns being a percentage. I have put the format of the cell as p0 and it works fine. Users that export the report to excel notice that a decimal appears after the value.

即.以前是"20%",现在是"20.%".如何摆脱."?

Ie. What used to be "20%" is now "20.%". How can I get rid of the "."?

推荐答案

如果这是使用CR进行的,我发现如果要始终将报表导出到Excel,则最好删除CR具有的所有格式/做.否则,您会遇到类似自己的怪异现象,并为您节省很多麻烦.

If this was made with CR, I've found that if a report is going to consistently be exported to Excel, it's best to remove ALL formatting that CR has/does. Otherwise you'll get weird anomalies like what you're experiencing and will save you a lot of grief down the road.

我为某些用户所做的工作是创建一个没有格式(专门用于导出)的报告,并创建一个包含所有CR内容的报告.

What I've done for some of my users is create one report with no formatting, specifically for exporting, and one report with all the bells and whistles of CR.

这篇关于ReportViewer“导出到Excel"在百分比值上加上小数.我该如何覆盖呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆