报表增加千分位显示
挂载报表表单插件即可
using Kingdee.BOS.Core.Report.PlugIn;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HL.K3Cloud.PUS.ProductionWarehousingReport.Plugin
{
[Description("客户详细分析表单插件-增加千分位")]
public class CustomerAnalysisBill: AbstractSysReportPlugIn
{
public override void FormatCellValue(Kingdee.BOS.Core.Report.PlugIn.Args.FormatCellValueArgs args)
{
base.FormatCellValue(args);
List<String> strList = new List<string>() { "FAMOUNT", "FReturnAMOUNT", "FCostAmount_LC", "Fprofit", "FArrearsMoneny", "FNightStock", "FEightyStock", "FStock", "FSingleAmount","FNightStockCount","FEightyStockCount"
,"FSingleAmountAverage","FSheetAmount","FSheetAmountAverage","FHeterotypicAmount","FHeterotypicAmountAverage","FOtherAmount","FOtherAmountAverage","FStockCount"};
if (strList.Contains(args.Header.Key))
{
decimal value = decimal.Parse(args.FormateValue);
string afterValue = value.ToString("N3").TrimEnd('0').TrimEnd('.');
args.FormateValue = afterValue;
}
//else if (args.Header.Key == "FAMOUNT" || args.Header.Key == "FSALCOSTPRICE" || args.Header.Key == "FPROFIT")
//{
// decimal value = decimal.Parse(args.FormateValue);
// string afterValue = value.ToString("N");
// args.FormateValue = afterValue;
//}
//else if (args.Header.Key == "FPROFITRATE")
//{
// decimal value = decimal.Parse(args.FormateValue);
// string afterValue = value.ToString("N4");
// args.FormateValue = afterValue;
//}
}
}
}
报表增加千分位显示
本文2024-09-16 18:42:40发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-23904.html