DATAREPORT显示图片

huangsenji 2008-01-22 12:17:48
各位大哥,我想在DATAREPORT上显示图片要怎样做,我做了一个数据库存放了图片的地址,因为图片很多,可是在报表里要怎样才能对应显示图片啊.DATAREPORT里提供的图片的控件好像做不到这个功能.

...全文
124 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zz005 2008-07-24
  • 打赏
  • 举报
回复
顶上去!高人来吧!
huangsenji 2008-03-20
  • 打赏
  • 举报
回复
再来顶一下.各位大哥.我用DATAREPORT来做报表,用里面的PRTIMAGE想到办法来打印图了,可是两张不同资料的单有两张不同的图,可是我写的那个只能打出两张不同资料的单,但是不能打出两张不同的图,如果是一张张来打就可以打得到,可以如果两张一齐打印就只会出同一个图.有什么办法可以做到打出两张不同的图呢.

Private Sub Command4_Click()

Call MSFlexGrid1_LeaveCell
Call MSFlexGrid1_EnterCell

Dim iRow As Integer
Dim sql As String
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
sql = ""
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\jxh\data\ck.mdb"
Set rs = New ADODB.Recordset
For iRow = 1 To MSFlexGrid1.Rows - 1
If MSFlexGrid1.TextMatrix(iRow, 0) <> "" And MSFlexGrid1.TextMatrix(iRow, 8) = "√" Then
sql = sql & "'" & MSFlexGrid1.TextMatrix(iRow, 0) & "',"
End If
Next
If sql <> "" Then
sql = Left(sql, Len(sql) - 1)
Else
MsgBox "请选择要打印的单"
Exit Sub
End If
sql = "select * from kdzl as fp where 款式单号 in(" & sql & ")"
rs.Open sql, cn, 2, 1

Set DataReport2.DataSource = rs
DataReport2.DataMember = rs.DataMember
If rs("图片名") <> "" Then
Set DataReport2.Sections("Section1").Controls("Image1").Picture = LoadPicture(rs("图片名"))
End If
DataReport2.Sections("Section1").Controls("txt款式单号").DataField = "款式单号"
DataReport2.Sections("Section1").Controls("txt成色").DataField = "成色"
DataReport2.Sections("Section1").Controls("txt开单日期").DataField = "开单日期"
DataReport2.Sections("Section1").Controls("txt备注").DataField = "备注"
DataReport2.Sections("Section1").Controls("txt石资料").DataField = "石资料"
DataReport2.Sections("Section1").Controls("txt制品序号").DataField = "制品序号"
DataReport2.Sections("Section1").Controls("txt承造").DataField = "承造"
DataReport2.Sections("Section1").Controls("txt完成日期").DataField = "完成日期"
DataReport2.Sections("Section1").Controls("txt数量").DataField = "数量"
DataReport2.Sections("Section1").Controls("txt类型").DataField = "类型"
DataReport2.Sections("Section1").Controls("txt字印").DataField = "字印"
DataReport2.PrintReport True

End Sub
huangsenji 2008-01-31
  • 打赏
  • 举报
回复
没有人会吗?各位大哥帮帮忙啊.

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧