Foxtable(狐表)用户栏目专家坐堂 → 1.判断当前计算机上是否存某个数据库,2.出货单报表


  共有2326人关注过本帖平板打印复制链接

主题:1.判断当前计算机上是否存某个数据库,2.出货单报表

美女呀,离线,留言给我吧!
漂亮美眉vszh
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:870 积分:7870 威望:0 精华:0 注册:2013/5/30 11:27:00
1.判断当前计算机上是否存某个数据库,2.出货单报表  发帖心情 Post By:2021/2/19 15:58:00 [只看该作者]

老师,有两个问题
1.SQL数据库,如果我连接的是A,如何用代码判断本机
上是否存在B数据库?

此主题相关图片如下:12314.png
按此在新窗口浏览图片
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")
doc.Body.Children.Add(rtt2)
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 = ""
doc.Body.Children.Add(rtt2)
    Next
End If
Dim rt As prt.RenderText
    rt = New prt.RenderText() '创建文本对象
    rt.Text = "白联  黄联  红联信息 "  '设置文本对象的内容
    rt.Width = 35 '宽度为35毫米
    rt.Height = 15 '高度为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 '垂直居中
ra.Children.Add(rt)
doc.Body.Children.Add(ra) '将容器加入到报表
doc.Preview() '预览

 回到顶部