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

  • SEARCH
  • Home
  • 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 8336959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:09:03+00:00 2026-06-09T04:09:03+00:00

I try to save my localreport in image format. But I discover that DeviceInfo

  • 0

I try to save my localreport in image format. But I discover that DeviceInfo‘s ColorDepth setting doesn’t work.

 string mime, encoding, fileNameExtension;
 string[] streams;
 Warning[] warnings;
 byte[] bytes = report.Render("IMAGE", @"<DeviceInfo><OutputFormat>TIFF</OutputFormat><ColorDepth>8</ColorDepth><StartPage>0</StartPage></DeviceInfo>", out mime, out encoding, out fileNameExtension, out streams, out warnings);

 FileStream fs = new FileStream("C:\\imgRep.tiff", FileMode.OpenOrCreate);
 fs.Write(bytes, 0, bytes.Length);
 fs.Close();

Independently of ColorDepth value, the result is .tiff file with ColorDepth = 24.

Does anyone know how to fix this bug?

I convert this bytes into another PixelFormat:

Bitmap orig = new Bitmap(new MemoryStream(bytes));
Bitmap clone = orig.Clone(new Rectangle(0, 0, orig.Width, orig.Height), PixelFormat.Format8bppIndexed);
clone.Save(@"c:\imgPixelF.tiff", ImageFormat.Tiff);

But I’m not sure it is a good decision..

  • 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. Editorial Team
    Editorial Team
    2026-06-09T04:09:04+00:00Added an answer on June 9, 2026 at 4:09 am

    According to SQL Server Books Online TIFF-images you render from reports will always be saved as 24-bit in current versions.

    For this release of SQL Server, the value of this setting is ignored, and the TIFF image is always rendered as 24-bit.

    Since ReportViewer/LocalReport is just a clientside use of SQL Server Reporting Services you will be bound by the same limitation there.

    It is a bit curious though that they say that ColorDepth is only supported for TIFF-images, and in the next sentence they say that the setting is ignored anyway in the current version and has been so since SQL Server 2005.

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

Sidebar

Related Questions

I installed libjpeg and PIL, but when I try to save a JPG image,
When I try to save an image using either System.Drawing.Image.Save(String) or System.Drawing.Bitmap.Save(String) an exception
I'm getting an error when I try to save a model that has a
I try to save a screenshot into the DB. But I cannot figure out
I try to save some data in internal storage on android but I keep
I have a problem that when I try to save an object in the
When i am displaying image from folder using Handler.ashx ans then try to save
I try to save a image from camera or photo album into application directory.
I try to save user's birth date, but get null value in column dob
i try to save an margin value in a resourcedictionary. Something like that: xmlns:systemwindows=clr-namespace:System.Windows;assembly=System.Windows.dll

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.