使用来自ftp的reportviewer显示图像
我编写了自定义代码以提供用户名和密码
I wrote custom code to supply username and password
Public Shared Function testimage(ByVal imageURL As String) As Byte()
Dim request As System.Net.WebClient = New System.Net.WebClient()
request.Credentials = New System.Net.NetworkCredential("Ftpuser", "1234567", "myPcname")
Try
Dim img() As Byte = request.DownloadData(imageURL)
Return img
Catch ex As Exception
Return Nothing
End Try
End Function
我也启用EnableExternalImages
Also I enable EnableExternalImages
this.reportViewer1.LocalReport.EnableExternalImages = true;
我写的表达 = Code.testimage(First(Fields!Pic_Path.Value,数据集1))
I wrote expression =Code.testimage(First(Fields!Pic_Path.Value, "Dataset1"))
Image source = Database<br />
MiME Type = Image/Jpeg
我将Path存储在我的数据库中,如 ftp://192.168.111.1:1234/1.jpg
我在测试解决方案中测试VB代码并且工作正常所以我想到目前为止一切都很好但是毕竟图像没有显示在报告上所以可能有人告诉我我想念的是什么
我检查那些链接
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e3e98956 -0b7c-498a-9a3a-86ec7b426cfa / display-image-from-ftp-server-folder-in-the reportviewer-and-ftp-folder-has-username-password?forum = sqlreportingservices [ ^ ]
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e3e98956-0b7c-498a-9a3a-86ec7b426cfa/display-image-from-ftp-server-folder-in- -reportviewer-and-ftp-folder-has-username-password?forum = sqlreportingservices [ ^ ]
所以任何建议!
I store the Path on My Database like ftp://192.168.111.1:1234/1.jpg
I test VB Code in test solution and it works fine So i guess everything so far is good but after all the Image is not displaying on the report so could some one tell me what i miss
I check those links
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e3e98956-0b7c-498a-9a3a-86ec7b426cfa/display-image-from-ftp-server-folder-in-the-reportviewer-and-ftp-folder-has-username-password?forum=sqlreportingservices[^]
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e3e98956-0b7c-498a-9a3a-86ec7b426cfa/display-image-from-ftp-server-folder-in-the-reportviewer-and-ftp-folder-has-username-password?forum=sqlreportingservices[^]
So Any suggestion !!!