以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 1.判断当前计算机上是否存某个数据库,2.出货单报表 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=160738) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:漂亮美眉vszh -- 发布时间:2021/2/19 15:58:00 -- 1.判断当前计算机上是否存某个数据库,2.出货单报表 老师,有两个问题 1.SQL数据库,如果我连接的是A,如何用代码判断本机 上是否存在B数据库? 2.专业报表打印出货单,出货单右侧有一排小字,我用了容器,但代码写的不对,按例子做的,查不出哪里错了
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:有点蓝 -- 发布时间:2021/2/19 16:14:00 -- 1、TryConnect:http://www.foxtable.com/webhelp/topics/1944.htm,能够连接就有 2、 Dim doc As New PrintDoc() \'定义一个报表 Dim ra As New prt.RenderArea \'定义一个容器 Dim rtt2 As New prt.RenderTable() \'定义一个表格对象 rtt2.name = "tb2" \'rtt.y = 26 rtt2.Width = "100%Parent.Width" rtt2.Cols(0).Width= "8%Parent.Width" rtt2.Cols(1).Width= "25%Parent.Width" rtt2.Cols(2).Width= "25%Parent.Width" rtt2.Cols(3).Width= "10%Parent.Width" rtt2.Cols(4).Width= "10%Parent.Width" \'rtt.Cols(5).Width= "%Parent.Width" rtt2.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rtt2.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居 rtt2.Cells(0,0).Text="序号" rtt2.Cells(0,1).Text= "产品名称" rtt2.Cells(0,2).Text="规格型号" rtt2.Cells(0,3).Text= "数量" rtt2.Cells(0,4).Text="单位" rtt2.Cells(0,5).Text="备注" rtt2.Style.Padding.Top=2 rtt2.Style.Font=New Font("宋体", 12) rtt2.Style.GridLines.All = New prt.Linedef \'设置网格线 rtt2.CellStyle.Spacing.All = 1 \'内容距离网格线1毫米 \'rtt.Style.Spacing.Top=14 rtt2.RowGroups(0,2).Header = prt.TableHeaderEnum.All \'将第一行作为表头. \'Dim drsa As List(of DataRow) = DataTables("EntOut").Select("Main_ID = \'" & s("_Identify") & "\'") \'Dim ki As Integer = 0 Dim coui As Integer = 3 For i As Integer = 0 To 3 - 1 \'drsa.Count - 1 \' ki += 1 rtt2.Cells(i + 1,0).Text = i + 1 rtt2.Cells(i + 1,1).Text= "111" \' drsa(i)("Mat_Name") rtt2.Cells(i + 1,1).Style.TextAlignHorz=prt.AlignHorzEnum.left rtt2.Cells(i + 1,2).Text = "222" \' Functions.Execute("ExcelGgtSpec_1",DataTables("EntOut"),drsa(i)) rtt2.Cells(i + 1,2).Style.TextAlignHorz=prt.AlignHorzEnum.left rtt2.Cells(i + 1,3).Text = "333" \' drsa(i)("EntQuant") rtt2.Cells(i + 1,4).Text = "444" \' drsa(i)("_unit") rtt2.Cells(i + 1,5).Text = "555" \' drsa(i)("_Remarks") Next If coui < 5 Then \' drsa.Count < 5 Then For ii As Integer = coui + 1 To 5 + 1 \' drsa.Count + ki + 1 rtt2.Cells(ii,0).Text = "" rtt2.Rows(ii).Height = 6 rtt2.Cells(ii,1).Text = "" rtt2.Cells(ii,2).Text = "" rtt2.Cells(ii,3).Text = "" rtt2.Cells(ii,4).Text = "" rtt2.Cells(ii,5).Text = "" Next End If doc.Body.Children.Add(rtt2) Dim rt As prt.RenderText rt = New prt.RenderText() \'创建文本对象 rt.x = "Parent.right" rt.y = 20 rt.Text = "白联 黄联 红联信息 " \'设置文本对象的内容 rt.Width = 10 \'宽度为35毫米 rt.Height = 60 \'高度为15毫米 rt.Style.Spacing.All = 2 \'设置各个方向的间隔 rt.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框 rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rt.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居中 doc.Body.Children.Add(rt) \'将容器加入到报表 doc.Preview() \'预览 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:漂亮美眉vszh -- 发布时间:2021/2/20 9:11:00 --
如果出货单超出一页时,前面的页数上就没有 如何在前面一页也加上右侧的备注小字? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:有点蓝 -- 发布时间:2021/2/20 10:06:00 -- 这种要手动分页,参考:http://www.foxtable.com/webhelp/topics/2241.htm Dim doc As New PrintDoc() \'定义一个报表 Dim prs As Integer = 6 \'每页6行 Dim cnt As Integer = 20 \' tb.Rows.Count For p As Integer = 0 To math.Ceiling(cnt / prs) - 1 Dim rtt2 As New prt.RenderTable() \'定义一个表格对象 \'rtt.y = 26 rtt2.Width = "100%Parent.Width" rtt2.Cols(0).Width= "8%Parent.Width" rtt2.Cols(1).Width= "25%Parent.Width" rtt2.Cols(2).Width= "25%Parent.Width" rtt2.Cols(3).Width= "10%Parent.Width" rtt2.Cols(4).Width= "10%Parent.Width" \'rtt.Cols(5).Width= "%Parent.Width" rtt2.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rtt2.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居 rtt2.Cells(0,0).Text="序号" rtt2.Cells(0,1).Text= "产品名称" rtt2.Cells(0,2).Text="规格型号" rtt2.Cells(0,3).Text= "数量" rtt2.Cells(0,4).Text="单位" rtt2.Cells(0,5).Text="备注" rtt2.Style.Padding.Top=2 rtt2.Style.Font=New Font("宋体", 12) rtt2.Style.GridLines.All = New prt.Linedef \'设置网格线 rtt2.CellStyle.Spacing.All = 1 \'内容距离网格线1毫米 For c As Integer = 0 To 5 For r As Integer = p * prs To math.min(cnt - 1,( p + 1) * prs - 1) rtt2.Cells(r - p * prs + 1, c).Text = r & "," & c Next Next If p < math.Ceiling(cnt / prs) - 1 Dim rt As prt.RenderText rt = New prt.RenderText() \'创建文本对象 rt.x = "Parent.right" rt.y = 20 rt.Text = "白联 黄联 红联信息 " \'设置文本对象的内容 rt.Width = 10 \'宽度为35毫米 rt.Height = 60 \'高度为15毫米 rt.Style.Spacing.All = 2 \'设置各个方向的间隔 rt.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框 rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rt.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居中 doc.Body.Children.Add(rt) \'将容器加入到报表 rtt2.BreakAfter = prt.BreakEnum.Page End If doc.Body.Children.Add(rtt2) Next doc.Preview() \'预览 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:漂亮美眉vszh -- 发布时间:2021/2/20 11:39:00 -- 老师,又出了新问题 每次都多出一个空白页面,能删掉么?
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:漂亮美眉vszh -- 发布时间:2021/2/20 11:39:00 -- 此主题相关图片如下:111.png |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:有点蓝 -- 发布时间:2021/2/20 11:47:00 -- Dim doc As New PrintDoc() \'定义一个报表 Dim prs As Integer = 6 \'每页6行 Dim cnt As Integer = 20 \' tb.Rows.Count For p As Integer = 0 To math.Ceiling(cnt / prs) - 1 Dim rt As prt.RenderText rt = New prt.RenderText() \'创建文本对象 rt.x = "Parent.right" rt.y = 20 rt.Text = "白联 黄联 红联信息 " \'设置文本对象的内容 rt.Width = 10 \'宽度为35毫米 rt.Height = 60 \'高度为15毫米 rt.Style.Spacing.All = 2 \'设置各个方向的间隔 rt.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框 rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rt.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居中 doc.Body.Children.Add(rt) \'将容器加入到报表 Dim rtt2 As New prt.RenderTable() \'定义一个表格对象 If p < math.Ceiling(cnt / prs) - 1 rtt2.BreakAfter = prt.BreakEnum.Page End If \'rtt.y = 26 rtt2.Width = "100%Parent.Width" rtt2.Cols(0).Width= "8%Parent.Width" rtt2.Cols(1).Width= "25%Parent.Width" rtt2.Cols(2).Width= "25%Parent.Width" rtt2.Cols(3).Width= "10%Parent.Width" rtt2.Cols(4).Width= "10%Parent.Width" \'rtt.Cols(5).Width= "%Parent.Width" rtt2.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中 rtt2.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居 rtt2.Cells(0,0).Text="序号" rtt2.Cells(0,1).Text= "产品名称" rtt2.Cells(0,2).Text="规格型号" rtt2.Cells(0,3).Text= "数量" rtt2.Cells(0,4).Text="单位" rtt2.Cells(0,5).Text="备注" rtt2.Style.Padding.Top=2 rtt2.Style.Font=New Font("宋体", 12) rtt2.Style.GridLines.All = New prt.Linedef \'设置网格线 rtt2.CellStyle.Spacing.All = 1 \'内容距离网格线1毫米 For c As Integer = 0 To 5 For r As Integer = p * prs To math.min(cnt - 1,( p + 1) * prs - 1) rtt2.Cells(r - p * prs + 1, c).Text = r & "," & c Next Next doc.Body.Children.Add(rtt2) Next doc.Preview() \'预览
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- 作者:小美菜 -- 发布时间:2021/2/20 16:34:00 -- 学下 |