locked
How to add Image into TextBox in RDLC reports RRS feed

  • Question

  • User-1995655362 posted

     I want to add a images in textbox control in RDLC files using the <a> tag or <img> tag.

    I know texbox control supports limited HTML tags in RDLC.but

    Is there any way to add the images in RDLC reports with out using the the Image control.

    OR

    can we add the image control in text box control.

     

    Wednesday, October 3, 2012 2:09 AM

All replies

  • User1729680291 posted

    I guess, for adding images you need a image control.

    By the way, u want to show a static image or image is coming from db?

    alternatively check these links - http://msdn.microsoft.com/en-us/library/ms156388.aspx

    http://kiavashshakibaee.blogspot.in/2008/07/display-database-image-in-ssrs-from.html

    Wednesday, October 3, 2012 4:31 AM
  • User-1995655362 posted

    Hi DreamBig,

    I want to add image in textbox's placeholder.

    In textbox data is coming from the custom code as below

    Public Function GetDataYesNo(ByVal value As String) As String
            Dim str As String
            str = "<ul><li>"
            Dim val As String
            Dim i As Integer
            For i = 0 To 2
                str = str & "<span class='inner-label'><div class='radio' > <span><input type='radio' style='opacity: 0;'></span>  </div>"
                If (i = 0) Then
                    If (value = "Y") Then
                        val = "<b><font color='blue'>" & "Yes" & "</font></b>"
                    Else
                        val = "Yes"
                    End If
                ElseIf (i = 1) Then
                    If (value = "N") Then
                        val = "<b><font color='blue'>" & "No" & "</font></b>"
                    Else
                        val = "No"
                    End If
                Else
                    If (value = "X") Then
                        val = "<b><font color='blue'>" & "None" & "</font></b>"
                    Else
                        val = "None"
                    End If
                End If
                str = str & val
                str = str & "</span>"
            Next
            str = str & "</li></ul>"
    'str ="<a href='file:///C:\inetpub\wwwroot\Filesanywhere\Images\Flags\in.gif'/>"  & "<li><input type='radio' style='opacity: 0;' >Male '<input type='radio' style='opacity: 0;'>Female <input type='radio' style='opacity: 0;'>Child </li>"
            Return str
        End Function

    I want to add the a image file in between text. As Textbox is supporting the <font>,<li> and other tags.

    Can i use the <img> ot <a> tag to show the image.

    Thanks

    Piyush

     

    Wednesday, October 3, 2012 5:02 AM
  • User1012859993 posted

    1- Create Text Parameter

    2- Add Image Control to the Report

    3- Set the Image to be External external and set "Use this image" to be the parameter: [@ParameterName].

    4- Finally Set the Parameter Value in Code behind before loading the report.

    Setting image source in RDLC report dynamically

    Monday, February 25, 2013 8:41 AM
  • Monday, February 25, 2013 2:37 PM
  • User1525838032 posted

    Thank you, MuhammadOmar, it works perfectly.

    I guess it's the best and cleaner way to add the image in the report.

    Thank you again.

    Thursday, September 12, 2013 11:01 AM