我们都知道K3 WISE BOS平台的开放能力是非常强的,经常会碰到需要定制报表的情况,那么在自定义报表中是否可以让特定行显示颜色,是否可以定义多表头报表呢?当然是可以的,只要你明白报表系统的规划,这是完全可以实现的,接下来我们来看一下具体实现过程。
报表表体特定行显示颜色
方法是在查询语句中增加fsumsort字段并赋值,在K3查询分析器不显示该字段,如下面示例:
SELECT fsumsort = 101, t2.FID AS FCostObjID, t2.FDate, CASE WHEN t4.FDProperty = 1070 THEN 0 ELSE 1 END AS FOrder , t4.FName AS FDeptName, t5.FName AS FProdLineName, t6.FNumber, t6.FName, t6.FModel, 0 AS FLevel, CASE WHEN t2.FType = 1 THEN '产成品' ELSE '在产品' END AS FType, '' AS FExpName, '' FCostName, '' AS FProcessName, '' AS FDeviceNumber, '' AS FDeviceName, '' AS FDeviceModel,0 AS FAmount, 0 AS FBase, 0 AS FSubbase,t2.FQty, t2.FCost
FROM dbo.t_MGLCostObject AS t2 WITH(NOLOCK)
LEFT JOIN dbo.t_Department AS t4 WITH(NOLOCK) ON t2.FDeptID = t4.FItemID
LEFT JOIN dbo.t_DevProductionLine AS t5 WITH(NOLOCK) ON t2.FProdLineID = t5.FItemID
LEFT JOIN dbo.t_ICItem AS t6 WITH(NOLOCK) ON t2.FItemID = t6.FItemID
WHERE YEAR(t2.FDate) = '@fyear@'
AND MONTH(t2.FDate) = '@fperiod@'
不同的赋值在报表中会显示不同的颜色,如下:
- fsumsort = 100 草绿色
- fsumsort = 101 淡黄色
- fsumsort = 102 浅紫色
实现多行表头功能
需要在自定义报表的表头文件表ICChatBillTitle中的FColCaption字段进行相应的设备即可。