Imports Microsoft.Reporting.WinForms
Public Class frmParcode
Dim Br As New BarCode
Private Sub btn_Prnit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Prnit.Click
frmPrint.ReportViewer1.LocalReport.EnableExternalImages = True
Dim h As String = Application.StartupPath & "\1.bmp"
PictureBox1.Image = Br.Code128(txtNumberEx1.Text, "B")
SaveImage("1.bmp", PictureBox1.Image)
Dim Pimg1 As New ReportParameter("Pimg1", "file:\\\" & h)
frmPrint.ReportViewer1.LocalReport.SetParameters(Pimg1) 'هنا توجد المشكلة
frmPrint.ReportViewer1.RefreshReport()
frmPrint.Show()
End Sub
Public Sub SaveImage(ByVal filename As String, ByVal image As Image)
Dim path As String = System.IO.Path.Combine(Application.StartupPath, filename)
Dim mySource As New Bitmap(image.Width, image.Height)
Dim grfx As Graphics = Graphics.FromImage(mySource)
grfx.DrawImageUnscaled(image, Point.Empty)
grfx.Dispose()
mySource.Save(filename, System.Drawing.Imaging.ImageFormat.Png)
mySource.Dispose()
End Sub
Private Sub btn_Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Exit.Click
End
End Sub
End Class