21-12-17, 07:52 AM
21-12-17, 10:08 AM
بعد عمل التقرير كما في الفيديو
هذا تحويل الكود من سي شارب الى vb.net
هذا تحويل الكود من سي شارب الى vb.net
PHP كود :
Public Class Form1
Dim imageUrl As String
Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
Using ofd As New OpenFileDialog With {.Filter = "JPEG|*.jpg"}
If ofd.ShowDialog = DialogResult.OK Then
imageUrl = ofd.FileName
PictureBox1.Image = Image.FromFile(ofd.FileName)
End If
End Using
End Sub
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
If Not String.IsNullOrEmpty(imageUrl) Then
Using frm As New frmPrint With {._imageUrl = imageUrl}
frm.ShowDialog()
End Using
End If
End Sub
End Class
PHP كود :
Imports Microsoft.Reporting.WinForms
Imports System.IO
Public Class frmPrint
Public _imageUrl As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim fi As New FileInfo(_imageUrl)
ReportViewer1.LocalReport.EnableExternalImages = True
Dim pName As New ReportParameter("pName", fi.Name)
Dim pImageUrl As New ReportParameter("pImageUrl", New Uri(_imageUrl).AbsoluteUri)
ReportViewer1.LocalReport.SetParameters({pName, pImageUrl})
ReportViewer1.LocalReport.Refresh()
Me.ReportViewer1.RefreshReport()
End Sub
End Class