c# - 如何删除时间并仅在 RDLC 中显示日期

标签 c# winforms rdlc

我正在使用 Winform(C#) 和 RDLC MySQL。因为我尝试只在 Tablex 中显示日期。

但是这种日期格式也有时间。如何删除时间。

我的表达是,..

=Fields!date.Value

请参阅下面的报告。

enter image description here

提前致谢?

我在表达式中尝试了 =Fields!date.Value.ToString("dd/MM/yyyy") 但它通过错误,.. 错误 1 ​​验证时出错。 HRESULT = '8000000A'

最佳答案

您可以使用 FormatDateTime方法:

=FormatDateTime(Fields!date.Value, DateFormat.ShortDate)

或者您可以在属性窗口中设置格式: enter image description here

关于c# - 如何删除时间并仅在 RDLC 中显示日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9140630/

相关文章:

c# - 计算运行平均值的合适集合是什么?

c# - 私有(private)诠释? _城市_Id;谁能告诉我 "?"在这里是什么意思

c# - Monogame C# - 如何在图 block map 图层 0 和 1 之间绘制 Sprite ?

c# - 通过Datatable在DataGridView中添加Combobox

c# - 如何为 VBA.GetObject 向 COM 公开正在运行的 .NET 应用程序对象? (不重复)

c# - 从 c# 将 rdl 报告导出到多张 excel 文件有问题

c# - MainWindow 构造函数被调用两次

C# 应用程序在切换到 TLS 1.2 后无法再访问网站 - GetResponse() 失败

winforms - 将 RDLC 输出作为电子邮件附件分发

reporting-services - RDLC 报告中的矩形高度是否固定?