以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何实现这样的单元格绘图  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=76085)

--  作者:宏丰ERP
--  发布时间:2015/10/21 15:11:00
--  [求助]如何实现这样的单元格绘图
求指导:1.如何将单元格的数值列和绘图分开,绘图单独一列。如图所示:
              
              将绘图分别在图示1和图示2的2个列内绘制。

             
图片点击可在新窗口打开查看此主题相关图片如下:1-1.png
图片点击可在新窗口打开查看
             
图片点击可在新窗口打开查看此主题相关图片如下:1-2.png
图片点击可在新窗口打开查看

           2.如何将代码里“总计值”换成“自动求和值”

              If e.Col.Name = "检验数" AndAlso e.Row.IsNull("检验数") = False Then
    e.StartDraw()
    Dim Width As Integer = (e.Width - 2 )* e.Row("检验数") \\ 12345
    If e.Row("检验数") = 100 Then
        e.Graphics.FillRectangle(Brushes.Green,e.x + 1,e.y + 1, Width, e.Height - 2)
    Else
        e.Graphics.FillRectangle(Brushes.Green,e.x + 1,e.y + 1, Width, e.Height - 2)
    End If
    e.EndDraw()
End If
If e.Col.Name = "不合格数" AndAlso e.Row.IsNull("不合格数") = False Then
    e.StartDraw()
    Dim Width As Integer = (e.Width - 2 )* e.Row("不合格数") \\ 142
    If e.Row("不合格数") = 100 Then
        e.Graphics.FillRectangle(Brushes.red,e.x + 1,e.y + 1, Width, e.Height - 2)
    Else
        e.Graphics.FillRectangle(Brushes.red,e.x + 1,e.y + 1, Width, e.Height - 2)
    End If
    e.EndDraw()
End If

3.如何在合计栏最后一个单元格内实现“求值”。

    142/12344=1.15%

           

--  作者:大红袍
--  发布时间:2015/10/21 15:17:00
--  
上传具体例子。
--  作者:宏丰ERP
--  发布时间:2015/10/21 15:18:00
--  
上传了
--  作者:大红袍
--  发布时间:2015/10/21 15:20:00
--  
上线foxtable例子。
--  作者:宏丰ERP
--  发布时间:2015/10/21 15:20:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:sqe.rar


--  作者:大红袍
--  发布时间:2015/10/21 15:28:00
--  

If e.Col.Name = "图示1" AndAlso e.Row.IsNull("检验数") = False Then
    e.StartDraw()
    Dim Width As Integer = (e.Width - 2 )* e.Row("检验数") \\ e.Table.Compute("sum(检验数)")
    If e.Row("检验数") = 100 Then
        e.Graphics.FillRectangle(Brushes.Green,e.x + 1,e.y + 1, Width, e.Height - 2)
    Else
        e.Graphics.FillRectangle(Brushes.Green,e.x + 1,e.y + 1, Width, e.Height - 2)
    End If
    e.EndDraw()
End If
If e.Col.Name = "图示2" AndAlso e.Row.IsNull("不合格数") = False Then
    e.StartDraw()
    Dim Width As Integer = (e.Width - 2 )* e.Row("不合格数") \\ e.Table.Compute("sum(不合格数)")
    If e.Row("不合格数") = 100 Then
        e.Graphics.FillRectangle(Brushes.red,e.x + 1,e.y + 1, Width, e.Height - 2)
    Else
        e.Graphics.FillRectangle(Brushes.red,e.x + 1,e.y + 1, Width, e.Height - 2)
    End If
    e.EndDraw()
End If

If e.Col.name = "不合格率" AndAlso e.Row("型号") = "总计" Then
    e.text = format(e.Table.Compute("sum(不合格数)")/e.Table.Compute("sum(检验数)"),"0.00%")
End If


--  作者:宏丰ERP
--  发布时间:2015/10/21 15:30:00
--  
再请教一下大红袍,如何将不合格率的0%显示成0.00%呢?
--  作者:大红袍
--  发布时间:2015/10/21 15:39:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20151021153902.jpg
图片点击可在新窗口打开查看

--  作者:宏丰ERP
--  发布时间:2015/10/21 15:40:00
--  
谢谢大红袍哥!
在请教2个问题
1.表格里的不合格率是0%或者1.5%的,如何显示成0.00%或者1.50%?

2.表格里的不合格率如果出现大于2.00%的数值,能不能将它的颜色变成红色加重突出显示出来?


--  作者:大红袍
--  发布时间:2015/10/21 16:17:00
--  

1、8楼;

 

2、http://www.foxtable.com/help/topics/0656.htm