各位老师们:好
我想把C盘下新建文件中的的包含JPG的图片全部导入报表并存为PDF文件,但下面的命令只能导入一下,不能全部导入!
Dim fl As String = "c:\data\test.pdf"
Dim doc As New PrintDoc '定义一个报表对象
Dim count As Integer = 0
'Dim count As Integer = 1
For Each f As String In FileSys.GetFiles("C:\Users\Administrator\Desktop\新建文件夹\")
If FileSys.GetName(f) Like "*jpg" Then
'count + = 1
count + = 1
'Messagebox.show(FileSys.GetName(f))
End If
Next
Messagebox.show(count)
For i As Integer = 1 To count
Dim rm As New prt.RenderImage '定义一个图片对象
rm.Width = "100%Parent" '设置尺寸为容器(页面)尺寸
rm.Height = "100%Parent"
' rm.Image = GetImage(FileSys.GetName(f))
rm.Image = GetImage(e.Form.Controls("TextBox04").value) '设置图片
doc.Body.Children.Add(rm) '将图片对象加入报表
Next
doc.SavePDF(fl) '保存为PDF文件
Dim Proc As New Process '打开PDF文件
Proc.File = fl
Proc.Start()
请各位老师指教!谢谢!