以文本方式查看主题

-  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=61921)

--  作者:石四
--  发布时间:2014/12/22 14:01:00
--  不敢(不会)乱动

不用多说,详见附件

 


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

--  作者:有点甜
--  发布时间:2014/12/22 14:15:00
--  
 例子发上来。
--  作者:石四
--  发布时间:2014/12/22 14:43:00
--  

这是教程上的,专业报表,分组打印,我要做的与这相似


--  作者:有点甜
--  发布时间:2014/12/22 14:47:00
--  

  参考函数 http://www.foxtable.com/help/topics/2747.htm

 


--  作者:石四
--  发布时间:2014/12/22 14:52:00
--  


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

 

Dim doc As New PrintDoc
Dim rt As Prt.RenderTable
Dim rx As prt.RenderText
Dim tbl As Table = Tables("外协加工")
Dim Rows As List(Of DataRow)
Dim Datas As List(Of String) = tbl.DataTable.GetValues("单据编号",tbl.Filter)
doc.Pagesetting.LandScape = True
For Each Data As String In Datas
    rx = New prt.RenderText
    rx.Style.FontSize = 16
    rx.Style.FontBold = True
    rx.Style.Spacing.Bottom = 6
    rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'文本内容水平居中
    rx.Text = "外 协 发 料 单"
    doc.Body.Children.Add(rx)
   
    rx = New prt.RenderText
    rx.Style.FontSize = 10
    rx.Style.FontBold = False
    rx.Style.Spacing.Bottom = 2
    rx.Text = "发料单号: " & Data.split(" ")(0) & "                                                      经办人_______________" & "             复核_______________"
    doc.Body.Children.Add(rx)
    rt = New prt.RenderTable
    rt.Style.Font = Tables("外协加工").Font
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center
    rt.Style.GridLines.All = New prt.LineDef(0.3,Color.LightGray)
    rt.Style.Spacing.Bottom = 5
    rt.CellStyle.Spacing.All = 1
    rt.Style.Font = tbl.Font
    If tbl.Filter = "" Then
        Rows = tbl.DataTable.Select("[单据编号] = \'" & data & "\'")
    Else
        Rows = tbl.DataTable.Select("[单据编号] = \'" & data & "\' And (" & tbl.Filter & ")")
    End If
    Dim ColNames As String() = New String(){"零件图号", "零件名称","出库数量"}
   
    For c As Integer = 0 To ColNames.Length - 1 \'逐列设置和填入内容
        rt.Cells(0,c).Text = ColNames(c) \'列名作为标题
        rt.Cells(0,3).Text = "数量"
        rt.Cells(0,c).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'标题内容水平居中
        rt.Cols(c).Width = tbl.Cols(ColNames(c)).PrintWidth \'列宽等于实际列宽
        If tbl.Cols(ColNames(c)).IsNumeric OrElse tbl.Cols(ColNames(c)).IsDate Then \'如果是数值或日期列
            rt.Cols(c).Style.TextAlignHorz = prt.AlignHorzEnum.Right \'数据水平靠右
        End If
       
        For r As Integer = 0 To Rows.Count -1
            rt.Cells(r + 1, c).Text = Rows(r)(ColNames(c))
        Next
    Next
    rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All
    doc.Body.Children.Add(rt)
Next
Doc.PageSetting.LeftMargin = 10 \'设置左边距
Doc.PageSetting.RightMargin = 10 \'设置右边距
Doc.PageSetting.TopMargin = 10 \'设置上边距
Doc.PageSetting.BottomMargin = 10 \'设置下边距
doc.PageSetting.Width = 215 \'纸张宽度为100毫米
doc.PageSetting.Height = 92 \'纸张高度为120毫米
doc.preview()


--  作者:有点甜
--  发布时间:2014/12/22 14:53:00
--  
 表弄上来。
--  作者:石四
--  发布时间:2014/12/22 14:55:00
--  
报表上还需要在单号前添加"日期",不知道怎么动,表上有日期列
--  作者:有点甜
--  发布时间:2014/12/22 14:56:00
--  
 表弄上来。
--  作者:石四
--  发布时间:2014/12/22 15:00:00
--  

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

--  作者:有点甜
--  发布时间:2014/12/22 15:01:00
--  
 例子发上来很难么。