Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 57067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:37:59+00:00 2026-05-10T17:37:59+00:00

I have a dynamically created image that I am saving to a stream so

  • 0

I have a dynamically created image that I am saving to a stream so that I can display it on a ReportViewer surface.

Setup:

  • Windows Client application (not WebForms)
  • Report datasource is an object datasource, with a dynamically generated stream as a property (CustomImage)
  • Report.EnableExternalImages = true
  • Image.Source = Database
  • Image.MIMEType = image/png
  • Image.Value = =Fields!CustomImage.Value

This is not working, but is not reporting any errors, just showing an empty image icon on the report surface. All other fields are displaying correctly.

Does anyone have a working code sample of this scenario?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:38:00+00:00Added an answer on May 10, 2026 at 5:38 pm

    I am doing something similar in order to have a changing logo on reports however I utilise report parameters to pass the value. I don’t see any reason why this general method wouldn’t work if the images were part of the data.

    Essentially the images are passed over two fields. The first field is the MIME Type value and the second field is a Base64 encoded string containing the image content.

    Step 1: Convert your image to Base64 encoding. (Our code always passes ImageFormat.Png to this method to make the MIME Type easy)

    private static string ConvertImageToBase64(Image image, ImageFormat format) {     byte[] imageArray;      using (System.IO.MemoryStream imageStream = new System.IO.MemoryStream())     {         image.Save(imageStream, format);         imageArray = new byte[imageStream.Length];         imageStream.Seek(0, System.IO.SeekOrigin.Begin);         imageStream.Read(imageArray, 0, imageStream.Length);     }      return Convert.ToBase64String(imageArray); } 

    Step 2: Pass the image and MIME Type to the report.

    reportParams[0] = new ReportParameter('ReportLogo', base64Logo); reportParams[1] = new ReportParameter('ReportLogoMimeType', 'image/png');  _reportViewer.LocalReport.SetParameters(reportParams); 

    Step 3: In the report set the following properties on the image (without the quotes):

    • MIMEType: "=Parameters!ReportLogoMimeType.Value"
    • Value: "=System.Convert.FromBase64String(Parameters!ReportLogo.Value)"
    • UPDATE: As Gerardo’s says below, the Image Source must be set to ‘Database’

    Trap for young players: Often the images will look horrible and like they’ve been scaled even though you’re passing in an image which seems to be the ‘right size’. This is because the reports are rendered for print (300 dpi) and not the screen (usually 72 or 92 dpi). The fix is to send in an image about 3 times too big, set it’s correct size in the report and change the ‘Sizing‘ property on the image to ‘FitProportional‘.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to put quotation marks around the path to… May 11, 2026 at 11:36 pm
  • Editorial Team
    Editorial Team added an answer Well I narrowed down the Issue. Please refer to the… May 11, 2026 at 11:36 pm
  • Editorial Team
    Editorial Team added an answer Find which is smaller: MaxWidth / w or MaxHeight /… May 11, 2026 at 11:36 pm

Related Questions

I am working on an ASP.Net web application that must print dynamically created labels
I created a plist that contains an NSDictionary structure. The key is a label
I have an iframe with a class name=blaclass. Inside it, I have one div
I have written a CGI script that creates an image dynamically using GET data.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.