加好友 发短信
等级:四尾狐
帖子:806
积分:6312
威望:0
精华:0
注册:2013/2/18 17:46:00
|
打印后台数据 Post By:2014/5/8 8:19:00 [显示全部帖子]
Dim doc As New PrintDoc Dim rt As New prt.RenderTable Dim cmd As New SQLCommand '定义一个SQL命令 Dim dt As DataTable '定义一个数据表变量 Dim Count As Integer = 0 cmd.CommandText = "Select * From {订单} Where Year(日期) = 2009 And Month(日期) = 6" dt = cmd.ExecuteReader() '生成一个临时表 For Each Col AS DataCol In Dt.DataCols rt.Cells(0,Count).Text = Col.Name For r As integer = 0 To dt.DataRows.Count - 1 rt.Cells(r +1,Count).Text = dt.DataRows(r)(Col.Name) Next Count = Count + 1 Next rt.Style.Gridlines.All = New prt.Linedef(Color.Gray) '灰色网格线 rt.CellStyle.Spacing.All = 1 '内容距离网格线1毫米 rt.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center '第一行内容水平居中 doc.Body.Children.Add(rt) doc.Preview()
日期列为空,打印显示为0:00:00
如何使打印显示也为空呢?
|
|