Adding an image to a Crystal Report from a memorystream. RRS feed

  • Question

  • Basically, i'm using a Charting tool in a webbased app to export a chart as a memorystream. The image itself is in PNG format (can also use BMP if needed).

    How do i import this memorystream into a PictureObject in a Crystal Report? Or is what i'm trying to do impossible?

    I've been looking around the internet, and it seems like i should be converting it to a byte array, and then sending that to CR, but that doesn't seem to work either.

    I was hoping for something like this...
    MemoryStream imagestream = (MemoryStream)Session["ChartStream"];
    byte[] image = imagestream.ToByteArray();
    PictureObject graphProbe = Report_CIA.ReportDefinition.ReportObjects["Picture2"] as PictureObject;
    GraphProbe = image;
    Wednesday, August 10, 2005 1:33 PM


  • Hello,

    The .NET tools with Crystal Reports do not support what you are trying to do.  Something like this may be possible with the Report Designer Component (RDC) or the Report Application Server (RAS), but then both of these technologies would have other limitations.

    A possible solution would be to push the image into an ADO.NET dataset.  You could create a subreport (unlinked) off of this dataset and at runtime push the image to the sub report.

    Keith - Business Objects
    • Proposed as answer by neonprimetime Monday, July 21, 2008 7:07 PM
    Friday, August 12, 2005 7:48 PM