以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]怎么设置打印 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=64670) |
||||
-- 作者:moxuejiahui -- 发布时间:2015/2/26 20:13:00 -- [求助]怎么设置打印 我在窗口中的一控件,写入 了以下代码,以及附件中的模板。各位帮我看看要怎么样才能进行页面设置,以及纸张的选择,并且直接打印。当然要是能够帮我看下模板中怎么设置自动满页是最好的了,我根据帮助上加了“-9”可是就不能填充数据了。谢谢各位。 Dim ckdh As WinForm.TextBox =e.Form.Controls("出库单号") Dim rq As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1") Dim kg As WinForm.TextBox = e.Form.Controls("制单") Dim Book As New XLS.Book(ProjectPath & "相关文件\\mb2.xls") Dim fl As String = ProjectPath & "Reports\\mb2.xls" Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(1,2).Value = " "& rq.text &"" Sheet(1,9).Value = " "& ckdh.text &"" Sheet(4,2).Value = " "& kg.text &"" Sheet(3,10).Value = "<出库单号 = \'"& ckdh.text &"\'>" Book.Build() Dim Proc As New Process Proc.File = fl Proc.Start()
|
||||
-- 作者:有点甜 -- 发布时间:2015/2/26 20:16:00 -- 1、打印设置,你在模板那里设置好即可;
2、可以用vba进行打印,也就是是你Book.Build之后,用vba打开,参考
打印输出
http://www.foxtable.com/help/topics/2121.htm
|
||||
-- 作者:moxuejiahui -- 发布时间:2015/2/26 20:28:00 -- 谢谢,同时想问问试用版可以用多久啊,购买要多少钱呢? |
||||
-- 作者:有点甜 -- 发布时间:2015/2/26 20:30:00 -- 以下是引用moxuejiahui在2015/2/26 20:28:00的发言:
谢谢,同时想问问试用版可以用多久啊,购买要多少钱呢?
试用版可以使用3个月到半年,看使用频率。
软件价格参考 http://www.foxtable.com/buy.html
[此贴子已经被作者于2015/2/26 20:30:48编辑过]
|
||||
-- 作者:moxuejiahui -- 发布时间:2015/2/26 23:33:00 -- 帮我看看我现在的代码要想设置纸张大小的话要怎么写代码,纸张是230mm*943mm Dim d As Date = Date.Today Dim y As Integer = d.Year Dim m As Integer = d.Month Dim bh As String = Format(d,"yyyyMM") Dim ckdh As WinForm.TextBox =e.Form.Controls("出库单号") Dim rq As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1") Dim kg As WinForm.TextBox = e.Form.Controls("制单") Dim Book As New XLS.Book(ProjectPath & "相关文件\\mb2.xls") \'打开模板 Dim fl As String = ProjectPath & "Reports\\mb2.xls" Dim Sheet As XLS.Sheet = Book.Sheets(0) Sheet(1,2).Value = " "& rq.text &"" Sheet(1,9).Value = " "& ckdh.text &"" Sheet(5,2).Value = " "& kg.text &"" Sheet(3,10).Value = "<出库单号 = \'"& ckdh.text &"\'>" \'写入打印条件 Book.Build() \'生成报表 Book.Save(fl) Dim App As New MSExcel.Application Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl) Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1) With Ws.PageSetup .PrintArea = Ws.UsedRange.Address \'打印工作表的使用区域 .LeftMargin = 20 \'页面左边距 .RightMargin = 20 \'页面右边距 .TopMargin = 20 \'页面顶部边距 .BottomMargin = 20 \'页面底部边距 .CenterHorizontally = True \'页面水平居中 .Orientation = MSExcel.xlPageOrientation.xlPortrait \'纵向打印 End With App.Visible = True Ws.PrintPreview Wb.Save Wb.SaveAs("E:\\网络版\\单据\\出库\\"& bh &"\\CK-"& ckdh.text &".xls") App.Quit |