RDL/RDLC Programatically insert image at runtime. Image shows in design but not in report viewer RRS feed

  • Question

  • Hi,

    My requirements are to create a dynamic header image that is generated at the moment of running the report.

    I have managed to do this with a comination of XMLDocument, creating images converting the images to base64, inserting them in the XML.

    Everything works to a point. In the rdlc file that I generate with the embedded image, if I view this in VS2008, I can see the new image. The XML renders fine.

    In the report viewer however I get a blank image. The header adjusts to the correct size, and everything appears to work. Except for the image.

    Enable external images is true just for testing. Makes no difference. I have also tried using an external image but to no avail. Same behaviour.

    Any ideas?

    PageHeader Tag from RDLC with Image

          <Textbox Name="textbox12">
            <Value>= "Fecha: " &amp; Day(Globals!ExecutionTime)&amp; "/" &amp; Month(Globals!ExecutionTime)&amp; "/" &amp; Year(Globals!ExecutionTime)</Value>
          <Textbox Name="textbox15">
            <Value>FICHA DATOS DE EMPRESA</Value>
          <Image Name="imganagrama" xmlns="">
    <Style />

      <EmbeddedImages xmlns="">
    <EmbeddedImage Name="anagrama">

    Tuesday, November 17, 2009 4:24 PM

All replies

  • FIXED!!!!!

    When creating the xml fragment there were no attributes in the image and embedded tags.

    I added this code to remove the xmlns="" attribute and now everything works!!!!



    strxml As String = My.Computer.FileSystem.ReadAllText(xmlruta)



    Dim strtext As String = "xmlns=" & Chr(34) & Chr(34)



    strxml = Replace(strxml, strtext, "")



    My.Computer.FileSystem.WriteAllText(xmlruta, strxml, False)



    Return xmlruta

    Wednesday, November 18, 2009 9:21 AM