Je télécharge des images sur le serveur et stocke leur chemin dans une table (varchar (MAX)).Image externe dans le rapport rdlc
J'ai réussi à créer un rapport et à afficher les enregistrements de cette table mais je n'ai pas pu lier l'image à sa source de données (chemin stocké).
Mon parcours ressemble à ceci:
~/ARTSQLDATA/PTDIR/15090248/IDFTO/15090248PPID.jpg
J'utilise le code suivant pour remplir mon jeu de données
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
RepVuerCtl.ProcessingMode = ProcessingMode.Local
RepVuerCtl.LocalReport.ReportPath = Server.MapPath("~/Account/RepPtProf.rdlc")
RepVuerCtl.LocalReport.EnableExternalImages = True
Dim DsPtProf As DSPtProf = GetData()
Dim datasource As New ReportDataSource("PatientProfile", DsPtProf.Tables(0))
RepVuerCtl.LocalReport.DataSources.Clear()
RepVuerCtl.LocalReport.DataSources.Add(datasource)
End If
End Sub
Private Function GetData() As DSPtProf
Dim ARTSQLCON As SqlConnection = New SqlConnection(-------())
Dim SQLCmd As New SqlCommand()
SQLCmd.Connection = ARTSQLCON
Using DtaRdr As New SqlDataAdapter(SQLCmd)
SQLCmd.CommandType = CommandType.StoredProcedure
SQLCmd.CommandText = "RepTblRegPtProf"
SQLCmd.Parameters.Add("@FileNum", SqlDbType.Int).Value = 15090248
Using DsPtProf As New DSPtProf()
DtaRdr.Fill(DsPtProf, "RepTblRegPtProf")
Return DsPtProf
End Using
End Using
End Function
S'il vous plaît Aide Merci!