Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
1.专来报表打印设置不选自定纸张...请大家帮手测试一下
2.专业报表如何将表中某列的数值如:10000转换为¥10,000.00格式及“壹万元整”大写格式
Dim
doc As New PrintDoc() '定义一个报表CUMoney
将阿拉伯数字转换为中文货币格式。
语法
CUMoney(Value)
Value:要转换的阿拉伯数字。
例如:
Dim Currency as String
Currency = CUMoney(12345.12)
Output.Show(Currency)
输出为:壹万贰千叁佰肆拾伍圆壹角贰分
Dim doc As New PrintDoc '定义一个报表
Dim rx As prt.RenderText '定义一个文本对象
Dim rm As prt.RenderImage '定义一个图形队形
doc.PageSetting.Width = 195 '纸张宽度为195毫米
doc.PageSetting.Height = 102 '纸张高度为102毫米
Dim x As Integer = 0 '定义水平偏移参数
Dim y As Integer = 0 '定义垂直偏移参数
Dim CurRow As Row = Tables("农业").Current
rx = new prt.RenderText
rx.Text = CurRow("年度")
rx.Style.FontSize = 16 '字体大小为16磅
rx.x = 38+ x
rx.y = 20+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("月份")
rx.x = 60+ x
rx.y = 20+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("日")
rx.x = 70+ x
rx.y = 20+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = "XXXXX" '拨款单位
rx.x = 46+ x
rx.y = 26+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = "123456"
rx.x = 46+ x
rx.y = 32+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = "XXXXXXXXXXXXXXX"
rx.x = 46+ x
rx.y = 40+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("单位_名称")
rx.x = 125+ x
rx.y = 26+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("单位_账号")
rx.x = 125+ x
rx.y = 32+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("单位_开户行")
rx.x = 125+ x
rx.y = 40+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("摘要")
rx.x = 32+ x
rx.y = 65+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("支出_小计")
rx.x = 125+ x
rx.y = 61+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("大写金额")
rx.x = 45+ x
rx.y = 61+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("科目编码")
rx.x = 125+ x
rx.y = 65+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("科目名称")
rx.x = 145+ x
rx.y = 65+ y
doc.body.Children.Add(rx)
Dim doc As New PrintDoc '定义一个报表
Dim rx As prt.RenderText '定义一个文本对象
Dim rm As prt.RenderImage '定义一个图形队形
doc.PageSetting.Width = 195 '纸张宽度为195毫米
doc.PageSetting.Height = 102 '纸张高度为102毫米
Dim x As Integer = 0 '定义水平偏移参数
Dim y As Integer = 0 '定义垂直偏移参数
Dim CurRow As Row = Tables("农业").Current
rx = new prt.RenderText
rx.Text = CurRow("年度")
rx.Style.FontSize = 16 '字体大小为16磅
rx.x = 38+ x
rx.y = 20+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("月份")
rx.x = 60+ x
rx.y = 20+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("日")
rx.x = 70+ x
rx.y = 20+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = "XXXXX" '拨款单位
rx.x = 46+ x
rx.y = 26+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = "123456"
rx.x = 46+ x
rx.y = 32+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = "XXXXXXXXXXXXXXX"
rx.x = 46+ x
rx.y = 40+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("单位_名称")
rx.x = 125+ x
rx.y = 26+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("单位_账号")
rx.x = 125+ x
rx.y = 32+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("单位_开户行")
rx.x = 125+ x
rx.y = 40+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("摘要")
rx.x = 32+ x
rx.y = 65+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("支出_小计")
rx.x = 125+ x
rx.y = 61+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("大写金额")
rx.x = 45+ x
rx.y = 61+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("科目编码")
rx.x = 125+ x
rx.y = 65+ y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("科目名称")
rx.x = 145+ x
rx.y = 65+ y
doc.body.Children.Add(rx)
doc.Preview() '预览
自定义纸张。。我用易表设置的套打单据一直在用
现想将易表的改为狐表 不想自定义纸张不能用 打印机是EPSON LQ635K
一选我原自定义纸张格式就变成其他格式纸张
大写转换
Dim Currency as String
Dim dx as String=Tables("农业").Current("支出_小计") ’260,111.00
Currency = CUMoney(dx)
e.DataRow("大写金额") = currency
可在命令窗口正常反映
但不知怎么在另一列"大写金额"显示出 不会弄事件请解说一下
如果是为了打印的需要,根本没需要增加一个大写金额列,只需在打印报表的时候:
rx.Text = CUMoney(CurRow("金额"))
如果一定要这么一列,请参考帮助文件“开发指南 - foxtable编程 - 计算代码”
关于自定义纸张,尝试一下:
Dim doc As New PrintDoc() '定义一个报表
Dim rt As prt.RenderText '定义一个文本对象
doc.Pagesetting.Paperkind = 0
doc.PageSetting.Width = 100 '纸张宽度为100毫米
doc.PageSetting.Height = 120 '纸张高度为120毫米
doc.Preview() '预览
对于关键的问题,应该先单独测试,然后再整体编写代码。