none
Dynamic Images RRS feed

  • Question

  •  

    I've been looking all over, searched through all the relevant topics on this support forum but I haven't found a solution to my problem. Hopefully someone here can help me.

     

    The problem: I'm creating a report where I need to display a dynamicly generated image. The image is added to the datasource and should be loaded but a red cross appears instead of the image.

     

    I'm using the following field for the dataset:

    Code Snippet

    <Field Name="Drawing">

    <DataField>Drawing</DataField>

    <rd:TypeName>System.Byte()</rd:TypeName>

    </Field>

     

     

     

    Assigning it to the datasource as follows:

    Code Snippet

    Dim ms As New System.IO.MemoryStream()

    image.Save(ms, Drawing.Imaging.ImageFormat.Bmp)

    Dim x As New DataSet()

    x.Tables.Add("Table")

    x.Tables(0).Columns.Add("Drawing")

    Dim dr As DataRow = x.Tables(0).NewRow()

    dr(0) = ms.ToArray()

    x.Tables(0).Rows.Add(dr)

    subReport.DataSources.Add( _

    New Microsoft.Reporting.WinForms.ReportDataSource( "DataSet", x.Tables(0)))

     

    I don't think anything is wrong with assigning the value to the datasource - Text fields display the data correctly.

     

     

    In the designer the settings for the image control are as follows:

    MIMEType: image/bmp

    Source: Database

    Value: =Fields!Drawing.Value

     

     

    Anyone who could tell me what it is I'm doing wrong would make my day. Thanks in advance!

     

     

    Wednesday, April 30, 2008 3:20 PM