If gsPrtReptCallReport = "rptFicheCaracterisation" Then
Try
Dim ds As New ImageDataSet
Dim fs As System.IO.FileStream = New System.IO.FileStream("C:\Documents and Settings\jobink\Desktop\To Finish\PROJET_NET\Img\EC 3 - TNB-SSE-Logo.JPG", System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim Image() As Byte = New Byte(fs.Length - 1) {}
myReport = New rptFicheCaracterisation
Using da As New DataTable("objDataTable")
da.Columns.Add("EspaceClos_FilePath", GetType(Byte()))
ds.Tables(0).Rows.Add()
fs.Read(Image, 0, CType(fs.Length, Integer))
fs.Close()
ds.Tables(0).Rows(0)("EspaceClos_FilePath") = Image
myReport.SetDataSource(ds.Tables(0))
myReport = New rptFicheCaracterisation
crParameterDiscreteValue.Value = giPrtReptEspaceClos
crParameterFieldDefinitions = myReport.DataDefinition.ParameterFields()
crParameterFieldDefinition = crParameterFieldDefinitions.Item("ParamEspaceClosID")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
End Using
Catch ex As Exception
Throw New Exception(ex.Message)
End Try
End If
With myConnectionInfo
.UserID = "admin"
.Password = "candev"
End With
CrReportViewer.DisplayGroupTree = False
CrReportViewer.ShowExportButton = False
CrReportViewer.ShowRefreshButton = False
myTableLogonInfo.connectioninfo = myConnectionInfo
myTableLogonInfos.Add(myTableLogonInfo)
CrReportViewer.LogOnInfo = myTableLogonInfos
CrReportViewer.ReportSource = myReport
CrReportViewer.Refresh()
|